Skip to content

Commit c6d7e77

Browse files
authored
Merge pull request #45 from LeakIX/fix-mypy-test-annotations
Add return type annotations to test functions
2 parents 8aa1cf6 + a7d4423 commit c6d7e77

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ and this project adheres to
2929
- Fix leaked file handles in tests using context managers ([b66a6f5], [#25])
3030
- Fix `Decimal.normalize()` stripping trailing zeros, breaking round-trip
3131
serialization; add regression test ([28c76f1], [0130743], [#28])
32+
- Add return type annotations to test functions for mypy compliance
33+
([cd74b55], [#43])
3234
- Fix typo in test name: `test_l9events_form_ip4scout` ->
3335
`test_l9events_from_ip4scout` ([0d8736e], [#27])
3436

@@ -154,6 +156,7 @@ and this project adheres to
154156

155157
<!-- Commit links -->
156158

159+
[cd74b55]: https://github.com/LeakIX/l9format-python/commit/cd74b55
157160
[0130743]: https://github.com/LeakIX/l9format-python/commit/0130743
158161
[28c76f1]: https://github.com/LeakIX/l9format-python/commit/28c76f1
159162
[b66a6f5]: https://github.com/LeakIX/l9format-python/commit/b66a6f5
@@ -230,3 +233,4 @@ and this project adheres to
230233
[#33]: https://github.com/LeakIX/l9format-python/issues/33
231234
[#25]: https://github.com/LeakIX/l9format-python/issues/25
232235
[#35]: https://github.com/LeakIX/l9format-python/issues/35
236+
[#43]: https://github.com/LeakIX/l9format-python/issues/43

tests/test_l9format.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
]
1313

1414

15-
def test_l9event_json_from_reference_repository():
15+
def test_l9event_json_from_reference_repository() -> None:
1616
path = TESTS_DIR / "l9event.json"
1717
with open(path) as f:
1818
c = json.load(f)
@@ -55,7 +55,7 @@ def test_l9event_json_from_reference_repository():
5555
]
5656

5757

58-
def test_l9events_from_ip4scout():
58+
def test_l9events_from_ip4scout() -> None:
5959
for path in IP4SCOUT_FILES:
6060
with open(path) as f:
6161
c = json.load(f)
@@ -68,7 +68,7 @@ def test_l9events_from_ip4scout():
6868
assert len(event.port) > 0
6969

7070

71-
def test_iso8601_nanosecond_parsing():
71+
def test_iso8601_nanosecond_parsing() -> None:
7272
"""
7373
Test ISO8601 datetime parsing with nanosecond precision.
7474
@@ -89,7 +89,7 @@ def test_iso8601_nanosecond_parsing():
8989
assert event.time.second == 36
9090

9191

92-
def test_all_models_importable_from_package():
92+
def test_all_models_importable_from_package() -> None:
9393
"""Verify all public models are importable from the l9format package."""
9494
import l9format
9595

0 commit comments

Comments
 (0)