Merge pull request #7835 from asottile/py36_misc
py36+: miscellaneous (3, 6) cleanup
This commit is contained in:
commit
ac189885f6
|
@ -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():
|
||||
...
|
||||
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -87,9 +87,7 @@ def iscoroutinefunction(func: object) -> bool:
|
|||
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:
|
||||
|
|
|
@ -1180,9 +1180,6 @@ def test_warn_on_async_function(testdir):
|
|||
|
||||
|
||||
@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="""
|
||||
|
|
|
@ -1421,8 +1421,7 @@ def test_error_attribute_issue555(testdir):
|
|||
|
||||
|
||||
@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:
|
||||
"""
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import enum
|
||||
import sys
|
||||
from functools import partial
|
||||
from functools import wraps
|
||||
from typing import TYPE_CHECKING
|
||||
|
@ -129,9 +128,6 @@ def test_is_generator_async_syntax(testdir):
|
|||
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(
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue