Skip to content

Commit

Permalink
tests: check py version for test_request_context
Browse files Browse the repository at this point in the history
  • Loading branch information
KingDarBoja committed Oct 28, 2020
1 parent 921bc12 commit 5adf64e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/quart/test_graphqlview.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import sys

# from io import StringIO
from urllib.parse import urlencode
Expand Down Expand Up @@ -36,7 +37,11 @@ async def execute_client(
headers: Headers = None,
**url_params
) -> Response:
async with app.test_request_context("/", method=method):
if sys.version_info >= (3, 7):
test_request_context = app.test_request_context("/", method=method)
else:
test_request_context = app.test_request_context(method, "/")
async with test_request_context:
string = url_for("graphql")

if url_params:
Expand Down

0 comments on commit 5adf64e

Please sign in to comment.