Skip to content

Commit

Permalink
ASYNC_AWAIT more like pytest-dev#37
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Sep 21, 2018
1 parent 62e2100 commit 555490e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions pytest_twisted.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import inspect
import sys

ASYNC_AWAIT = sys.version_info >= (3, 5)

if ASYNC_AWAIT:
import asyncio
else:
asyncio = None


import decorator
import greenlet
Expand Down
4 changes: 3 additions & 1 deletion testing/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import pytest

import pytest_twisted


def assert_outcomes(run_result, outcomes):
formatted_output = format_run_result_output_for_assert(run_result)
Expand Down Expand Up @@ -39,7 +41,7 @@ def skip_if_reactor_not(expected_reactor):

def skip_if_no_async_await():
return pytest.mark.skipif(
sys.version_info < (3, 5),
not pytest_twisted.ASYNC_AWAIT,
reason="async/await syntax not support on Python <3.5",
)

Expand Down

0 comments on commit 555490e

Please sign in to comment.