Skip to content

Commit 6583fc5

Browse files
committed
chore: codestyle
1 parent 0dd4e2c commit 6583fc5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

ckanext/files/tests/storage/test_link.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def test_protocols_setting(self, faker: Faker):
5454
location = shared.Location("file.txt")
5555

5656
url = faker.url(["http"])
57-
with RequestsMock() as rsps:
58-
rsps.add("HEAD", url)
59-
with pytest.raises(shared.exc.ContentError):
57+
with pytest.raises(shared.exc.ContentError): # noqa: PT012, SIM117
58+
with RequestsMock() as rsps:
59+
rsps.add("HEAD", url)
6060
storage.upload(location, shared.make_upload(url.encode()))
6161

6262
url = faker.url(["https"])
@@ -79,9 +79,9 @@ def test_domains_setting(self, faker: Faker):
7979
location = shared.Location("file.txt")
8080

8181
url = f"https://notallowed.com/{faker.file_name()}"
82-
with RequestsMock() as rsps:
83-
rsps.add("HEAD", url)
84-
with pytest.raises(shared.exc.ContentError):
82+
with pytest.raises(shared.exc.ContentError): # noqa: PT012, SIM117
83+
with RequestsMock() as rsps:
84+
rsps.add("HEAD", url)
8585
storage.upload(location, shared.make_upload(url.encode()))
8686

8787
url = f"https://{allowed_domain}/{faker.file_name()}"

0 commit comments

Comments
 (0)