Skip to content

Commit b690e4c

Browse files
committed
Check coverage by default only with latest Python
1 parent d6254c8 commit b690e4c

File tree

8 files changed

+24
-29
lines changed

8 files changed

+24
-29
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v3
1111

12-
- name: Set up Python 3.10
12+
- name: Set up Python 3.11
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: '3.10'
15+
python-version: '3.11'
1616

1717
- name: Install dependencies
1818
run: |

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v3
1414

15-
- name: Set up Python 3.10
15+
- name: Set up Python 3.11
1616
uses: actions/setup-python@v4
1717
with:
18-
python-version: '3.10'
18+
python-version: '3.11'
1919

2020
- name: Build wheel and source tarball
2121
run: |

tests/language/test_block_string_fuzz.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
print_block_string,
77
)
88

9-
from ..utils import dedent, gen_fuzz_strings, timeout_factor
9+
from ..utils import dedent, gen_fuzz_strings
1010

1111

1212
def lex_value(s: str) -> str:
@@ -42,7 +42,7 @@ def assert_non_printable_block_string(test_value: str) -> None:
4242

4343
def describe_print_block_string():
4444
@mark.slow
45-
@mark.timeout(80 * timeout_factor)
45+
@mark.timeout(80)
4646
def correctly_print_random_strings():
4747
# Testing with length >7 is taking exponentially more time. However, it is
4848
# highly recommended testing with increased limit if you make any change.

tests/utilities/test_build_ast_schema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
from ..fixtures import big_schema_sdl # noqa: F401
4141
from ..star_wars_schema import star_wars_schema
42-
from ..utils import dedent, timeout_factor
42+
from ..utils import dedent
4343

4444

4545
try:
@@ -1228,7 +1228,7 @@ def can_deep_copy_pickled_schema():
12281228

12291229
@mark.slow
12301230
def describe_deepcopy_and_pickle_big(): # pragma: no cover
1231-
@mark.timeout(20 * timeout_factor)
1231+
@mark.timeout(20)
12321232
def can_deep_copy_big_schema(big_schema_sdl): # noqa: F811
12331233
# use our printing conventions
12341234
big_schema_sdl = cycle_sdl(big_schema_sdl)
@@ -1240,7 +1240,7 @@ def can_deep_copy_big_schema(big_schema_sdl): # noqa: F811
12401240
# check that printing the copied schema gives the same SDL
12411241
assert print_schema(copied) == big_schema_sdl
12421242

1243-
@mark.timeout(60 * timeout_factor)
1243+
@mark.timeout(60)
12441244
def can_pickle_and_unpickle_big_schema(big_schema_sdl): # noqa: F811
12451245
# use our printing conventions
12461246
big_schema_sdl = cycle_sdl(big_schema_sdl)
@@ -1272,7 +1272,7 @@ def can_pickle_and_unpickle_big_schema(big_schema_sdl): # noqa: F811
12721272
finally:
12731273
sys.setrecursionlimit(limit)
12741274

1275-
@mark.timeout(60 * timeout_factor)
1275+
@mark.timeout(60)
12761276
def can_deep_copy_pickled_big_schema(big_schema_sdl): # noqa: F811
12771277
# use our printing conventions
12781278
big_schema_sdl = cycle_sdl(big_schema_sdl)

tests/utilities/test_introspection_from_schema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
)
1515

1616
from ..fixtures import big_schema_introspection_result, big_schema_sdl # noqa: F401
17-
from ..utils import dedent, timeout_factor
17+
from ..utils import dedent
1818

1919

2020
def introspection_to_sdl(introspection: IntrospectionQuery) -> str:
@@ -108,7 +108,7 @@ def can_deep_copy_pickled_schema():
108108

109109
@mark.slow
110110
def describe_deepcopy_and_pickle_big(): # pragma: no cover
111-
@mark.timeout(20 * timeout_factor)
111+
@mark.timeout(20)
112112
def can_deep_copy_big_schema(big_schema_sdl): # noqa: F811
113113
# introspect the original big schema
114114
big_schema = build_schema(big_schema_sdl)
@@ -119,7 +119,7 @@ def can_deep_copy_big_schema(big_schema_sdl): # noqa: F811
119119
# check that introspecting the copied schema gives the same result
120120
assert introspection_from_schema(copied) == expected_introspection
121121

122-
@mark.timeout(60 * timeout_factor)
122+
@mark.timeout(60)
123123
def can_pickle_and_unpickle_big_schema(big_schema_sdl): # noqa: F811
124124
# introspect the original big schema
125125
big_schema = build_schema(big_schema_sdl)
@@ -153,7 +153,7 @@ def can_pickle_and_unpickle_big_schema(big_schema_sdl): # noqa: F811
153153
finally:
154154
sys.setrecursionlimit(limit)
155155

156-
@mark.timeout(60 * timeout_factor)
156+
@mark.timeout(60)
157157
def can_deep_copy_pickled_big_schema(big_schema_sdl): # noqa: F811
158158
# introspect the original big schema
159159
big_schema = build_schema(big_schema_sdl)

tests/utilities/test_strip_ignored_characters_fuzz.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from graphql.language import Lexer, Source, TokenKind
88
from graphql.utilities import strip_ignored_characters
99

10-
from ..utils import dedent, gen_fuzz_strings, timeout_factor
10+
from ..utils import dedent, gen_fuzz_strings
1111

1212

1313
ignored_tokens = [
@@ -228,7 +228,7 @@ def does_not_strip_random_ignored_tokens_embedded_in_the_block_string():
228228
).to_stay_the_same()
229229

230230
@mark.slow
231-
@mark.timeout(80 * timeout_factor)
231+
@mark.timeout(80)
232232
def strips_ignored_characters_inside_random_block_strings():
233233
# Testing with length >7 is taking exponentially more time. However it is
234234
# highly recommended to test with increased limit if you make any change.

tests/utils/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
"""Test utilities"""
22

3-
from platform import python_implementation
4-
53
from .dedent import dedent
64
from .gen_fuzz_strings import gen_fuzz_strings
75

86

9-
# some tests can take much longer on PyPy
10-
timeout_factor = 4 if python_implementation() == "PyPy" else 1
11-
12-
13-
__all__ = ["dedent", "gen_fuzz_strings", "timeout_factor"]
7+
__all__ = ["dedent", "gen_fuzz_strings"]

tox.ini

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ python =
1414
pypy3.9: pypy39
1515

1616
[testenv:black]
17-
basepython = python3.10
17+
basepython = python3.11
1818
deps = black==23.1.0
1919
commands =
2020
black src tests -t py310 --check
2121

2222
[testenv:flake8]
23-
basepython = python3.10
23+
basepython = python3.11
2424
deps =
2525
flake8>=6,<7
2626
flake8-bandit>=4.1,<5
@@ -29,21 +29,21 @@ commands =
2929
flake8 src tests
3030

3131
[testenv:isort]
32-
basepython = python3.10
32+
basepython = python3.11
3333
deps = isort>=5.12,<6
3434
commands =
3535
isort src tests --check-only
3636

3737
[testenv:mypy]
38-
basepython = python3.10
38+
basepython = python3.11
3939
deps =
4040
mypy==1.0.0
4141
pytest>=7.2,<8
4242
commands =
4343
mypy src tests
4444

4545
[testenv:docs]
46-
basepython = python3.10
46+
basepython = python3.11
4747
deps =
4848
sphinx>=5.3,<6
4949
sphinx_rtd_theme>=1.1,<2
@@ -62,4 +62,5 @@ deps =
6262
commands =
6363
# to also run the time-consuming tests: tox -e py310 -- --run-slow
6464
# to run the benchmarks: tox -e py310 -- -k benchmarks --benchmark-enable
65-
pytest tests {posargs: --cov-report=term-missing --cov=graphql --cov=tests --cov-fail-under=100}
65+
py37,py38.py39,py310,pypy39: pytest tests {posargs}
66+
py311: pytest tests {posargs: --cov-report=term-missing --cov=graphql --cov=tests --cov-fail-under=100}

0 commit comments

Comments
 (0)