Skip to content

Commit 555490e

Browse files
committed
ASYNC_AWAIT more like #37
1 parent 62e2100 commit 555490e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

pytest_twisted.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
import inspect
2+
import sys
3+
4+
ASYNC_AWAIT = sys.version_info >= (3, 5)
5+
6+
if ASYNC_AWAIT:
7+
import asyncio
8+
else:
9+
asyncio = None
10+
211

312
import decorator
413
import greenlet

testing/test_basic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import pytest
55

6+
import pytest_twisted
7+
68

79
def assert_outcomes(run_result, outcomes):
810
formatted_output = format_run_result_output_for_assert(run_result)
@@ -39,7 +41,7 @@ def skip_if_reactor_not(expected_reactor):
3941

4042
def skip_if_no_async_await():
4143
return pytest.mark.skipif(
42-
sys.version_info < (3, 5),
44+
not pytest_twisted.ASYNC_AWAIT,
4345
reason="async/await syntax not support on Python <3.5",
4446
)
4547

0 commit comments

Comments
 (0)