old_contents: #!/usr/bin/env python
  
  """Tests for filesize humanizing."""
  
  from humanize import filesize
  
  from .base import HumanizeTestCase
  
  
  class FilesizeTestCase(HumanizeTestCase):
      def test_naturalsize(self):
          tests = (
              300,
              3000,
              3000000,
              3000000000,
              3000000000000,
              (300, True),
              (3000, True),
              (3000000, True),
              (300, False, True),
              (3000, False, True),
              (3000000, False, True),
              (1024, False, True),
              (10 ** 26 * 30, False, True),
              (10 ** 26 * 30, True),
              10 ** 26 * 30,
              (1, False, False),
              (3141592, False, False, "%.2f"),
              (3000, False, True, "%.3f"),
              (3000000000, False, True, "%.0f"),
              (10 ** 26 * 30, True, False, "%.3f"),
          )
          results = (
              "300 Bytes",
              "3.0 kB",
              "3.0 MB",
              "3.0 GB",
              "3.0 TB",
              "300 Bytes",
              "2.9 KiB",
              "2.9 MiB",
              "300B",
              "2.9K",
              "2.9M",
              "1.0K",
              "2481.5Y",
              "2481.5 YiB",
              "3000.0 YB",
              "1 Byte",
              "3.14 MB",
              "2.930K",
              "3G",
              "2481.542 YiB",
          )
          self.assertManyResults(filesize.naturalsize, tests, results)
  
new_contents: #!/usr/bin/env python
  
  """Tests for filesize humanizing."""
  
  import pytest
  from humanize import filesize
  
  
  @pytest.mark.parametrize(
      "test_args, expected",
      [
          ([300], "300 Bytes"),
          ([3000], "3.0 kB"),
          ([3000000], "3.0 MB"),
          ([3000000000], "3.0 GB"),
          ([3000000000000], "3.0 TB"),
          ([300, True], "300 Bytes"),
          ([3000, True], "2.9 KiB"),
          ([3000000, True], "2.9 MiB"),
          ([300, False, True], "300B"),
          ([3000, False, True], "2.9K"),
          ([3000000, False, True], "2.9M"),
          ([1024, False, True], "1.0K"),
          ([10 ** 26 * 30, False, True], "2481.5Y"),
          ([10 ** 26 * 30, True], "2481.5 YiB"),
          ([10 ** 26 * 30], "3000.0 YB"),
          ([1, False, False], "1 Byte"),
          ([3141592, False, False, "%.2f"], "3.14 MB"),
          ([3000, False, True, "%.3f"], "2.930K"),
          ([3000000000, False, True, "%.0f"], "3G"),
          ([10 ** 26 * 30, True, False, "%.3f"], "2481.542 YiB"),
      ],
  )
  def test_naturaltime_minimum_unit_default(test_args, expected):
      assert filesize.naturalsize(*test_args) == expected
  
subject: Convert test_filesize.py to use pytest