Skip to content

Commit 1d3525e

Browse files
committed
Use custom dedent function and pin graphql-core to >3.1.2
1 parent 9f28d2f commit 1d3525e

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

graphene/relay/tests/test_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import re
22
from graphql_relay import to_global_id
33

4-
from graphql.pyutils import dedent
4+
from graphene.tests.utils import dedent
55

66
from ...types import ObjectType, Schema, String
77
from ..node import Node, is_node

graphene/relay/tests/test_node_custom.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from graphql import graphql_sync
2-
from graphql.pyutils import dedent
2+
3+
from graphene.tests.utils import dedent
34

45
from ...types import Interface, ObjectType, Schema
56
from ...types.scalars import Int, String

graphene/tests/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from textwrap import dedent as _dedent
2+
3+
4+
def dedent(text: str) -> str:
5+
"""Fix indentation of given text by removing leading spaces and tabs.
6+
Also removes leading newlines and trailing spaces and tabs, but keeps trailing
7+
newlines.
8+
"""
9+
return _dedent(text.lstrip("\n").rstrip(" \t"))

graphene/types/tests/test_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
from graphql.type import GraphQLObjectType, GraphQLSchema
12
from pytest import raises
23

3-
from graphql.type import GraphQLObjectType, GraphQLSchema
4-
from graphql.pyutils import dedent
4+
from graphene.tests.utils import dedent
55

66
from ..field import Field
77
from ..objecttype import ObjectType

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def run_tests(self):
8282
keywords="api graphql protocol rest relay graphene",
8383
packages=find_packages(exclude=["examples*"]),
8484
install_requires=[
85-
"graphql-core>=3.1.1,<4",
85+
"graphql-core>=3.1.2,<4",
8686
"graphql-relay>=3.0,<4",
8787
"aniso8601>=8,<9",
8888
],

0 commit comments

Comments
 (0)