Skip to content

Commit f80029d

Browse files
Resolved code smells in test suite
1 parent a43b399 commit f80029d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Test suite for the `transpose-dict` package."""

tests/test_transpose_dict.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
from transpose_dict import TD
1+
"""Tests for transpose_dict package."""
2+
23
import json
4+
from transpose_dict import TD
5+
36

47
def test_transpose_dict():
5-
with open("tests/start.json", "r") as f:
8+
"""Test transpose_dict function."""
9+
with open("tests/start.json", "r", encoding="utf8") as f:
610
start = json.load(f)
711
for i in range(3):
8-
with open("tests/test_{i}.json".format(i=i), "r") as f:
12+
with open(f"tests/test_{i}.json", "r", encoding="utf8") as f:
913
print(TD(start, i))
10-
assert json.load(f) == TD(start, i)
14+
assert json.load(f) == TD(start, i)

tests/test_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55

66

77
def test_version():
8+
"""Test the version string for PEP440 compatibility."""
89
pattern = re.compile(r"\d+\.\d+\.\d+")
910
assert pattern.match(__version__)

0 commit comments

Comments
 (0)