From 2c879628d0ffaddab3235284f798d3a6f54cd16d Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Sun, 8 Feb 2026 00:11:27 -0300 Subject: [PATCH] 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 --- tests/test_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index d72b8d8..e132543 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -60,7 +60,7 @@ def test_accept_header(self): class TestGetHost: def test_get_host_success(self, client): for f in HOSTS_SUCCESS_RESULTS_DIR.iterdir(): - with open(str(f)) as ff: + with open(f) as ff: res_json = json.load(ff) ipv4 = f.name[:-5] # remove .json with requests_mock.Mocker() as m: @@ -73,7 +73,7 @@ def test_get_host_success(self, client): def test_get_host_404(self, client): for f in HOSTS_404_RESULTS_DIR.iterdir(): - with open(str(f)) as ff: + with open(f) as ff: res_json = json.load(ff) ipv4 = f.name[:-5] # remove .json with requests_mock.Mocker() as m: