Use test_client() as context manager

This commit is contained in:
Athanasios Voutsadakis
2017-11-16 17:02:38 +00:00
parent 3b30895a73
commit bde734dc75

View File

@@ -16,11 +16,11 @@ def test_route_correct_secret_key(app_, check_proxy_header, header_value, expect
'CHECK_PROXY_HEADER': check_proxy_header,
}):
client = app_.test_client()
response = client.get(
path='/_status?elb=True',
headers=[
('X-Custom-forwarder', header_value),
]
)
with app_.test_client() as client:
response = client.get(
path='/_status?elb=True',
headers=[
('X-Custom-forwarder', header_value),
]
)
assert response.status_code == expected_code