Skip to content

Commit 284fd45

Browse files
committed
py36+: miscellaneous (3, 6) cleanup
1 parent 325b988 commit 284fd45

File tree

6 files changed

+4
-18
lines changed

6 files changed

+4
-18
lines changed

doc/en/skipping.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ when run on an interpreter earlier than Python3.6:
9191
import sys
9292
9393
94-
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python3.6 or higher")
94+
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires python3.7 or higher")
9595
def test_function():
9696
...
9797

src/_pytest/capture.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ def _py36_windowsconsoleio_workaround(stream: TextIO) -> None:
113113
114114
See https://github.com/pytest-dev/py/issues/103.
115115
"""
116-
if (
117-
not sys.platform.startswith("win32")
118-
or sys.version_info[:2] < (3, 6)
119-
or hasattr(sys, "pypy_version_info")
120-
):
116+
if not sys.platform.startswith("win32") or hasattr(sys, "pypy_version_info"):
121117
return
122118

123119
# Bail out if ``stream`` doesn't seem like a proper ``io`` stream (#2666).

src/_pytest/compat.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ def syntax, and doesn't contain yield), or a function decorated with
9797
def is_async_function(func: object) -> bool:
9898
"""Return True if the given function seems to be an async function or
9999
an async generator."""
100-
return iscoroutinefunction(func) or (
101-
sys.version_info >= (3, 6) and inspect.isasyncgenfunction(func)
102-
)
100+
return iscoroutinefunction(func) or inspect.isasyncgenfunction(func)
103101

104102

105103
def getlocation(function, curdir: Optional[str] = None) -> str:

testing/acceptance_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,9 +1183,6 @@ def test_3():
11831183

11841184

11851185
@pytest.mark.filterwarnings("default")
1186-
@pytest.mark.skipif(
1187-
sys.version_info < (3, 6), reason="async gen syntax available in Python 3.6+"
1188-
)
11891186
def test_warn_on_async_gen_function(testdir):
11901187
testdir.makepyfile(
11911188
test_async="""

testing/test_capture.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,7 @@ def test_capattr():
14211421

14221422

14231423
@pytest.mark.skipif(
1424-
not sys.platform.startswith("win") and sys.version_info[:2] >= (3, 6),
1425-
reason="only py3.6+ on windows",
1424+
not sys.platform.startswith("win"), reason="only on windows",
14261425
)
14271426
def test_py36_windowsconsoleio_workaround_non_standard_streams() -> None:
14281427
"""

testing/test_compat.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import enum
2-
import sys
32
from functools import partial
43
from functools import wraps
54
from typing import Union
@@ -129,9 +128,6 @@ async def bar():
129128
result.stdout.fnmatch_lines(["*1 passed*"])
130129

131130

132-
@pytest.mark.skipif(
133-
sys.version_info < (3, 6), reason="async gen syntax available in Python 3.6+"
134-
)
135131
def test_is_generator_async_gen_syntax(testdir):
136132
testdir.makepyfile(
137133
"""

0 commit comments

Comments
 (0)