22
33from jinja2 import Environment
44
5- from .app import create_app
6- from .util import app , client , url_string
5+ from .app import create_app , url_string
76
87
98@pytest .fixture
@@ -21,17 +20,17 @@ def pretty_response():
2120 (create_app (async_executor = False , graphiql = True )),
2221 (create_app (async_executor = True , graphiql = True )),
2322])
24- def test_graphiql_is_enabled (app , client ):
25- response = client .get (app , uri = url_string (), headers = {'Accept' : 'text/html' })
23+ def test_graphiql_is_enabled (app ):
24+ _ , response = app . client .get ( uri = url_string (), headers = {'Accept' : 'text/html' })
2625 assert response .status == 200
2726
2827
2928@pytest .mark .parametrize ('app' , [
3029 (create_app (async_executor = False , graphiql = True )),
3130 (create_app (async_executor = True , graphiql = True )),
3231])
33- def test_graphiql_simple_renderer (app , client , pretty_response ):
34- response = client .get (app , uri = url_string (query = '{test}' ), headers = {'Accept' : 'text/html' })
32+ def test_graphiql_simple_renderer (app , pretty_response ):
33+ _ , response = app . client .get (uri = url_string (query = '{test}' ), headers = {'Accept' : 'text/html' })
3534 assert response .status == 200
3635 assert pretty_response in response .body .decode ('utf-8' )
3736
@@ -40,8 +39,8 @@ def test_graphiql_simple_renderer(app, client, pretty_response):
4039 (create_app (async_executor = False , graphiql = True , jinja_env = Environment ())),
4140 (create_app (async_executor = True , graphiql = True , jinja_env = Environment ())),
4241])
43- def test_graphiql_jinja_renderer (app , client , pretty_response ):
44- response = client .get (app , uri = url_string (query = '{test}' ), headers = {'Accept' : 'text/html' })
42+ def test_graphiql_jinja_renderer (app , pretty_response ):
43+ _ , response = app . client .get (uri = url_string (query = '{test}' ), headers = {'Accept' : 'text/html' })
4544 assert response .status == 200
4645 assert pretty_response in response .body .decode ('utf-8' )
4746
@@ -50,8 +49,8 @@ def test_graphiql_jinja_renderer(app, client, pretty_response):
5049 (create_app (async_executor = False , graphiql = True , jinja_env = Environment (enable_async = True ))),
5150 (create_app (async_executor = True , graphiql = True , jinja_env = Environment (enable_async = True ))),
5251])
53- def test_graphiql_jinja_async_renderer (app , client , pretty_response ):
54- response = client .get (app , uri = url_string (query = '{test}' ), headers = {'Accept' : 'text/html' })
52+ def test_graphiql_jinja_async_renderer (app , pretty_response ):
53+ _ , response = app . client .get (uri = url_string (query = '{test}' ), headers = {'Accept' : 'text/html' })
5554 assert response .status == 200
5655 assert pretty_response in response .body .decode ('utf-8' )
5756
@@ -60,6 +59,6 @@ def test_graphiql_jinja_async_renderer(app, client, pretty_response):
6059 (create_app (async_executor = False , graphiql = True , jinja_env = Environment ())),
6160 (create_app (async_executor = True , graphiql = True , jinja_env = Environment ())),
6261])
63- def test_graphiql_html_is_not_accepted (app , client ):
64- response = client .get (app , uri = url_string (), headers = {'Accept' : 'application/json' })
62+ def test_graphiql_html_is_not_accepted (app ):
63+ _ , response = app . client .get (uri = url_string (), headers = {'Accept' : 'application/json' })
6564 assert response .status == 400
0 commit comments