Skip to content

Commit 9243188

Browse files
committed
Stop checking exact error message as it depends of python env
1 parent 70c4190 commit 9243188

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/starwars/test_validation.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,23 @@ def validation_errors(client, query):
7575

7676

7777
def test_incompatible_request_gql(client):
78-
with pytest.raises(TypeError) as exc_info:
78+
with pytest.raises(TypeError):
7979
gql(123)
8080

8181
"""
8282
The error generated depends on graphql-core version
8383
< 3.1.5: "body must be a string"
84-
>= 3.1.5: "object of type 'int' has no len()"
84+
>= 3.1.5: some variation of "object of type 'int' has no len()"
85+
depending on the python environment
86+
87+
So we are not going to check the exact error message here anymore.
88+
"""
8589

86-
Just accepting both cases for now
8790
"""
8891
assert ("body must be a string" in str(exc_info.value)) or (
8992
"object of type 'int' has no len()" in str(exc_info.value)
9093
)
94+
"""
9195

9296

9397
def test_nested_query_with_fragment(client):

0 commit comments

Comments
 (0)