diff --git a/tests/integration/test_wild.py b/tests/integration/test_wild.py index 6e0df08..2db7744 100644 --- a/tests/integration/test_wild.py +++ b/tests/integration/test_wild.py @@ -63,12 +63,12 @@ def test_flickr_should_respond_with_200(tmpdir): def test_cookies(tmpdir, httpbin): testfile = str(tmpdir.join("cookies.yml")) with vcr.use_cassette(testfile): - s = requests.Session() - s.get(httpbin.url + "/cookies/set?k1=v1&k2=v2") - assert s.cookies.keys() == ["k1", "k2"] + with requests.Session() as s: + s.get(httpbin.url + "/cookies/set?k1=v1&k2=v2") + assert s.cookies.keys() == ["k1", "k2"] - r2 = s.get(httpbin.url + "/cookies") - assert sorted(r2.json()["cookies"].keys()) == ["k1", "k2"] + r2 = s.get(httpbin.url + "/cookies") + assert sorted(r2.json()["cookies"].keys()) == ["k1", "k2"] @pytest.mark.online