Fix 'unclosed file' warnings in tests
see https://github.com/pallets/flask/issues/2468#issuecomment-517797518
This commit is contained in:
parent
2ff958c55f
commit
60c906cb5c
@ -33,6 +33,7 @@ class TestLanguagesEndpoint(ApiTest):
|
|||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertIn("Content-Type", response.headers)
|
self.assertIn("Content-Type", response.headers)
|
||||||
self.assertEqual(response.headers["Content-Type"], "image/svg+xml; charset=utf-8")
|
self.assertEqual(response.headers["Content-Type"], "image/svg+xml; charset=utf-8")
|
||||||
|
response.close()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "main":
|
if __name__ == "main":
|
||||||
|
@ -41,12 +41,14 @@ class TestSkillsEndpoint(ApiTest):
|
|||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertIn("Content-Type", response.headers)
|
self.assertIn("Content-Type", response.headers)
|
||||||
self.assertEqual(response.headers["Content-Type"], "image/svg+xml; charset=utf-8")
|
self.assertEqual(response.headers["Content-Type"], "image/svg+xml; charset=utf-8")
|
||||||
|
response.close()
|
||||||
|
|
||||||
def test_get_fallback_skill_icon(self):
|
def test_get_fallback_skill_icon(self):
|
||||||
response = self.client.get("/skills/2/icon")
|
response = self.client.get("/skills/2/icon")
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertIn("Content-Type", response.headers)
|
self.assertIn("Content-Type", response.headers)
|
||||||
self.assertEqual(response.headers["Content-Type"], "image/svg+xml; charset=utf-8")
|
self.assertEqual(response.headers["Content-Type"], "image/svg+xml; charset=utf-8")
|
||||||
|
response.close()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "main":
|
if __name__ == "main":
|
||||||
|
Loading…
Reference in New Issue
Block a user