Skip to content

Commit f48c733

Browse files
committed
Catch a couple of additional leaked resources
1 parent 7b6a03c commit f48c733

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/test_json.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,8 @@ def test_set_path(client):
14111411

14121412
with open(jsonfile, "w+") as fp:
14131413
fp.write(json.dumps({"hello": "world"}))
1414-
open(nojsonfile, "a+").write("hello")
1414+
with open(nojsonfile, "a+") as fp:
1415+
fp.write("hello")
14151416

14161417
result = {jsonfile: True, nojsonfile: False}
14171418
assert client.json().set_path(Path.root_path(), root) == result

tests/test_ssl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def test_validating_self_signed_certificate(self, request):
6868
assert r.ping()
6969

7070
def test_validating_self_signed_string_certificate(self, request):
71-
f = open(self.SERVER_CERT)
72-
cert_data = f.read()
71+
with open(self.SERVER_CERT) as f:
72+
cert_data = f.read()
7373
ssl_url = request.config.option.redis_ssl_url
7474
p = urlparse(ssl_url)[1].split(":")
7575
r = redis.Redis(

0 commit comments

Comments
 (0)