Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py36+: miscellaneous (3, 6) cleanup #7835

Merged
merged 1 commit into from Oct 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/en/skipping.rst
Expand Up @@ -91,7 +91,7 @@ when run on an interpreter earlier than Python3.6:
import sys


@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python3.6 or higher")
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires python3.7 or higher")
def test_function():
...

Expand Down
6 changes: 1 addition & 5 deletions src/_pytest/capture.py
Expand Up @@ -113,11 +113,7 @@ def _py36_windowsconsoleio_workaround(stream: TextIO) -> None:

See https://github.com/pytest-dev/py/issues/103.
"""
if (
not sys.platform.startswith("win32")
or sys.version_info[:2] < (3, 6)
or hasattr(sys, "pypy_version_info")
):
if not sys.platform.startswith("win32") or hasattr(sys, "pypy_version_info"):
return

# Bail out if ``stream`` doesn't seem like a proper ``io`` stream (#2666).
Expand Down
4 changes: 1 addition & 3 deletions src/_pytest/compat.py
Expand Up @@ -97,9 +97,7 @@ def syntax, and doesn't contain yield), or a function decorated with
def is_async_function(func: object) -> bool:
"""Return True if the given function seems to be an async function or
an async generator."""
return iscoroutinefunction(func) or (
sys.version_info >= (3, 6) and inspect.isasyncgenfunction(func)
)
return iscoroutinefunction(func) or inspect.isasyncgenfunction(func)


def getlocation(function, curdir: Optional[str] = None) -> str:
Expand Down
3 changes: 0 additions & 3 deletions testing/acceptance_test.py
Expand Up @@ -1183,9 +1183,6 @@ def test_3():


@pytest.mark.filterwarnings("default")
@pytest.mark.skipif(
sys.version_info < (3, 6), reason="async gen syntax available in Python 3.6+"
)
def test_warn_on_async_gen_function(testdir):
testdir.makepyfile(
test_async="""
Expand Down
3 changes: 1 addition & 2 deletions testing/test_capture.py
Expand Up @@ -1421,8 +1421,7 @@ def test_capattr():


@pytest.mark.skipif(
not sys.platform.startswith("win") and sys.version_info[:2] >= (3, 6),
reason="only py3.6+ on windows",
not sys.platform.startswith("win"), reason="only on windows",
)
def test_py36_windowsconsoleio_workaround_non_standard_streams() -> None:
"""
Expand Down
4 changes: 0 additions & 4 deletions testing/test_compat.py
@@ -1,5 +1,4 @@
import enum
import sys
from functools import partial
from functools import wraps
from typing import Union
Expand Down Expand Up @@ -129,9 +128,6 @@ async def bar():
result.stdout.fnmatch_lines(["*1 passed*"])


@pytest.mark.skipif(
sys.version_info < (3, 6), reason="async gen syntax available in Python 3.6+"
)
def test_is_generator_async_gen_syntax(testdir):
testdir.makepyfile(
"""
Expand Down