8000 Fix graphqlview custom context test · graphql-python/flask-graphql@5accc9f · GitHub
[go: up one dir, main page]

Skip to content

Commit 5accc9f

Browse files
committed
Fix graphqlview custom context test
1 parent 5c977d9 commit 5accc9f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/test_graphqlview.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
def app():
2020
return create_app()
2121

22+
2223
def url_string(**url_params):
2324
string = url_for('graphql')
2425

@@ -328,7 +329,7 @@ def test_allows_post_with_get_operation_name(client):
328329

329330

330331
@pytest.mark.parametrize('app', [create_app(pretty=True)])
331-
def test_supports_pretty_printing(client):
332+
def test_supports_pretty_printing(app, client):
332333
response = client.get(url_string(query='{test}'))
333334

334335
assert response.data.decode() == (
@@ -341,7 +342,7 @@ def test_supports_pretty_printing(client):
341342

342343

343344
@pytest.mark.parametrize('app', [create_app(pretty=False)])
344-
def test_not_pretty_by_default(client):
345+
def test_not_pretty_by_default(app, client):
345346
response = client.get(url_string(query='{test}'))
346347

347348
assert response.data.decode() == (
@@ -451,11 +452,10 @@ def test_passes_request_into_request_context(client):
451452
}
452453

453454

454-
@pytest.mark.parametrize('app', [create_app(get_context=lambda:"CUSTOM CONTEXT")])
455-
def test_supports_pretty_printing(client):
455+
@pytest.mark.parametrize('app', [create_app(get_context_value=lambda:"CUSTOM CONTEXT")])
456+
def test_supports_pretty_printing_with_custom_context(app, client):
456457
response = client.get(url_string(query='{context}'))
457458

458-
459459
assert response.status_code == 200
460460
assert response_json(response) == {
461461
'data': {
@@ -468,7 +468,7 @@ def test_post_multipart_data(client):
468468
query = 'mutation TestMutation { writeTest { test } }'
469469
response = client.post(
470470
url_string(),
471-
data= {
471+
data={
472472
'query': query,
473473
'file': (StringIO(), 'text1.txt'),
474474
},
@@ -480,7 +480,7 @@ def test_post_multipart_data(client):
480480

481481

482482
@pytest.mark.parametrize('app', [create_app(batch=True)])
483-
def test_batch_allows_post_with_json_encoding(client):
483+
def test_batch_allows_post_with_json_encoding(app, client):
484484
response = client.post(
485485
url_string(),
486486
data=jl(
@@ -498,7 +498,7 @@ def test_batch_allows_post_with_json_encoding(client):
498498

499499

500500
@pytest.mark.parametrize('app', [create_app(batch=True)])
501-
def test_batch_supports_post_json_query_with_json_variables(client):
501+
def test_batch_supports_post_json_query_with_json_variables(app, client):
502502
response = client.post(
503503
url_string(),
504504
data=jl(
@@ -514,10 +514,10 @@ def test_batch_supports_post_json_query_with_json_variables(client):
514514
# 'id': 1,
515515
'data': {'test': "Hello Dolly"}
516516
}]
517-
518-
517+
518+
519519
@pytest.mark.parametrize('app', [create_app(batch=True)])
520-
def test_batch_allows_post_with_operation_name(client):
520+
def test_batch_allows_post_with_operation_name(app, client):
521521
response = client.post(
522522
url_string(),
523523
data=jl(

0 commit comments

Comments
 (0)
0