From 45c4aa9fa8c78d49b63a25e9e74a183919dae5f0 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 20 May 2020 14:09:44 +0400 Subject: [PATCH 1/2] Remove Python 3.5 support --- pytest_trio/_tests/test_async_yield_fixture.py | 16 ++++++---------- pytest_trio/plugin.py | 6 ------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/pytest_trio/_tests/test_async_yield_fixture.py b/pytest_trio/_tests/test_async_yield_fixture.py index 4810456..95d2df7 100644 --- a/pytest_trio/_tests/test_async_yield_fixture.py +++ b/pytest_trio/_tests/test_async_yield_fixture.py @@ -6,17 +6,13 @@ @pytest.fixture(params=['Python>=36', 'async_generator']) def async_yield_implementation(request): if request.param == 'Python>=36': - if sys.version_info < (3, 6): - pytest.skip("requires python3.6") - else: + def patch_code(code): + # Convert code to use Python>=3.6 builtin async generator + code = re.sub(r'(?m)^\s*@async_generator\n', r'', code) + code = re.sub(r'await yield_', r'yield', code) + return code - def patch_code(code): - # Convert code to use Python>=3.6 builtin async generator - code = re.sub(r'(?m)^\s*@async_generator\n', r'', code) - code = re.sub(r'await yield_', r'yield', code) - return code - - return patch_code + return patch_code else: return lambda x: x diff --git a/pytest_trio/plugin.py b/pytest_trio/plugin.py index 4901e49..12e774b 100644 --- a/pytest_trio/plugin.py +++ b/pytest_trio/plugin.py @@ -17,12 +17,6 @@ # Basic setup ################################################################ -if sys.version_info >= (3, 6): - ORDERED_DICTS = True -else: - # Ordered dict (and **kwargs) not available with Python<3.6 - ORDERED_DICTS = False - try: from hypothesis import register_random except ImportError: # pragma: no cover From 651e55884aed362fd876b9aa134c02f66d390798 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 20 May 2020 14:17:53 +0400 Subject: [PATCH 2/2] yapf --- pytest_trio/_tests/test_async_yield_fixture.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytest_trio/_tests/test_async_yield_fixture.py b/pytest_trio/_tests/test_async_yield_fixture.py index 95d2df7..4fa6098 100644 --- a/pytest_trio/_tests/test_async_yield_fixture.py +++ b/pytest_trio/_tests/test_async_yield_fixture.py @@ -6,6 +6,7 @@ @pytest.fixture(params=['Python>=36', 'async_generator']) def async_yield_implementation(request): if request.param == 'Python>=36': + def patch_code(code): # Convert code to use Python>=3.6 builtin async generator code = re.sub(r'(?m)^\s*@async_generator\n', r'', code)