Browse Source

add additional (internal) type hints to enable mypy's strict mode

https://github.com/fphammerle/ical2vdir/commit/a0190b0478b4fc90a0deca43fca6598c316bf800
https://github.com/fphammerle/ical2vdir/commit/cb1ef451c39008c4b4f1265e1eed31dac2c531d0
Fabian Peter Hammerle 2 years ago
parent
commit
28839ae92a
3 changed files with 4 additions and 3 deletions
  1. 1 0
      mypy.ini
  2. 2 2
      tests/data_size_to_bytes_test.py
  3. 1 1
      tests/test_cli.py

+ 1 - 0
mypy.ini

@@ -1,2 +1,3 @@
 [mypy]
+strict = True
 ignore_missing_imports = True

+ 2 - 2
tests/data_size_to_bytes_test.py

@@ -30,11 +30,11 @@ import free_disk
         ("1  MiB", 1024 ** 2),
     ],
 )
-def test__data_size_to_bytes(data_size_with_unit, expected_bytes):
+def test__data_size_to_bytes(data_size_with_unit: str, expected_bytes: int) -> None:
     assert expected_bytes == free_disk._data_size_to_bytes(data_size_with_unit)
 
 
 @pytest.mark.parametrize("data_size_with_unit", ["abcdef", "123G"])
-def test__data_size_to_bytes_fail(data_size_with_unit):
+def test__data_size_to_bytes_fail(data_size_with_unit: str) -> None:
     with pytest.raises(ValueError):
         free_disk._data_size_to_bytes(data_size_with_unit)

+ 1 - 1
tests/test_cli.py

@@ -1,7 +1,7 @@
 import subprocess
 
 
-def test_entrypoint():
+def test_entrypoint() -> None:
     assert subprocess.run(
         ["free-disk", "--help"], stdout=subprocess.PIPE, check=True
     ).stdout.startswith(b"usage: ")