Skip to content

Commit 2c87962

Browse files
committed
Remove str() wrapping on Path objects in tests
open() accepts Path objects directly since Python 3.6. Remove the unnecessary str() conversion in test_get_host_success and test_get_host_404. Closes #33
1 parent 50cf840 commit 2c87962

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_accept_header(self):
6060
class TestGetHost:
6161
def test_get_host_success(self, client):
6262
for f in HOSTS_SUCCESS_RESULTS_DIR.iterdir():
63-
with open(str(f)) as ff:
63+
with open(f) as ff:
6464
res_json = json.load(ff)
6565
ipv4 = f.name[:-5] # remove .json
6666
with requests_mock.Mocker() as m:
@@ -73,7 +73,7 @@ def test_get_host_success(self, client):
7373

7474
def test_get_host_404(self, client):
7575
for f in HOSTS_404_RESULTS_DIR.iterdir():
76-
with open(str(f)) as ff:
76+
with open(f) as ff:
7777
res_json = json.load(ff)
7878
ipv4 = f.name[:-5] # remove .json
7979
with requests_mock.Mocker() as m:

0 commit comments

Comments
 (0)