Skip to content

Commit cb6d4a3

Browse files
committed
Move ASYNC_AWAIT/GENERATORS to testing/test_basic.py
1 parent f4d95d6 commit cb6d4a3

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

pytest_twisted.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
import functools
22
import inspect
3-
import sys
4-
5-
# https://docs.python.org/3/whatsnew/3.5.html#pep-492-coroutines-with-async-and-await-syntax
6-
ASYNC_AWAIT = sys.version_info >= (3, 5)
7-
8-
# https://docs.python.org/3/whatsnew/3.6.html#pep-525-asynchronous-generators
9-
ASYNC_GENERATORS = sys.version_info >= (3, 6)
10-
113

124
import decorator
135
import greenlet

testing/test_basic.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
import pytest_twisted
77

88

9+
# https://docs.python.org/3/whatsnew/3.5.html#pep-492-coroutines-with-async-and-await-syntax
10+
ASYNC_AWAIT = sys.version_info >= (3, 5)
11+
12+
# https://docs.python.org/3/whatsnew/3.6.html#pep-525-asynchronous-generators
13+
ASYNC_GENERATORS = sys.version_info >= (3, 6)
14+
15+
916
def assert_outcomes(run_result, outcomes):
1017
formatted_output = format_run_result_output_for_assert(run_result)
1118

@@ -39,14 +46,14 @@ def skip_if_reactor_not(request, expected_reactor):
3946

4047
def skip_if_no_async_await():
4148
return pytest.mark.skipif(
42-
not pytest_twisted.ASYNC_AWAIT,
49+
not ASYNC_AWAIT,
4350
reason="async/await syntax not support on Python <3.5",
4451
)
4552

4653

4754
def skip_if_no_async_generators():
4855
return pytest.mark.skipif(
49-
not pytest_twisted.ASYNC_GENERATORS,
56+
not ASYNC_GENERATORS,
5057
reason="async generators not support on Python <3.6",
5158
)
5259

0 commit comments

Comments
 (0)