Skip to content

Commit ac18988

Browse files
authored
Merge pull request #7835 from asottile/py36_misc
py36+: miscellaneous (3, 6) cleanup
2 parents 6ba13ed + 284fd45 commit ac18988

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
@@ -87,9 +87,7 @@ def syntax, and doesn't contain yield), or a function decorated with
8787
def is_async_function(func: object) -> bool:
8888
"""Return True if the given function seems to be an async function or
8989
an async generator."""
90-
return iscoroutinefunction(func) or (
91-
sys.version_info >= (3, 6) and inspect.isasyncgenfunction(func)
92-
)
90+
return iscoroutinefunction(func) or inspect.isasyncgenfunction(func)
9391

9492

9593
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
@@ -1180,9 +1180,6 @@ def test_3():
11801180

11811181

11821182
@pytest.mark.filterwarnings("default")
1183-
@pytest.mark.skipif(
1184-
sys.version_info < (3, 6), reason="async gen syntax available in Python 3.6+"
1185-
)
11861183
def test_warn_on_async_gen_function(testdir):
11871184
testdir.makepyfile(
11881185
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 TYPE_CHECKING
@@ -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)