Skip to content

Commit 5adf64e

Browse files
committed
tests: check py version for test_request_context
1 parent 921bc12 commit 5adf64e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/quart/test_graphqlview.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import sys
23

34
# from io import StringIO
45
from urllib.parse import urlencode
@@ -36,7 +37,11 @@ async def execute_client(
3637
headers: Headers = None,
3738
**url_params
3839
) -> Response:
39-
async with app.test_request_context("/", method=method):
40+
if sys.version_info >= (3, 7):
41+
test_request_context = app.test_request_context("/", method=method)
42+
else:
43+
test_request_context = app.test_request_context(method, "/")
44+
async with test_request_context:
4045
string = url_for("graphql")
4146

4247
if url_params:

0 commit comments

Comments
 (0)