Browse Source

fix flask context

Bastien Sevajol 6 years ago
parent
commit
aac9e15249
2 changed files with 2 additions and 1 deletions
  1. 1 0
      hapic/ext/flask/context.py
  2. 1 1
      tests/func/fake_api/test_flask.py

+ 1 - 0
hapic/ext/flask/context.py View File

@@ -106,4 +106,5 @@ class FlaskContext(ContextInterface):
106 106
         return FLASK_RE_PATH_URL.sub(r'{\1}', contextualised_rule)
107 107
 
108 108
     def by_pass_output_wrapping(self, response: typing.Any) -> bool:
109
+        from flask import Response
109 110
         return isinstance(response, Response)

+ 1 - 1
tests/func/fake_api/test_flask.py View File

@@ -18,7 +18,7 @@ def test_func_flask_fake_api():
18 18
     )
19 19
 
20 20
     assert doc == SWAGGER_DOC_API
21
-    resp = app.get('/about')
21
+    resp = app.get('/about', status='*')
22 22
     assert resp.status_int == 200
23 23
     assert resp.json == {'datetime': '2017-12-07T10:55:08.488996+00:00',
24 24
                          'version': '1.2.3'}