summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2020-10-02 12:13:44 -0700
committerAnthony Sottile <asottile@umich.edu>2020-10-02 15:04:16 -0700
commit284fd45a086f3943b616fed1e608a3109d372c3b (patch)
tree4cf52b632fb1f267336902ccc2f234f24cf89cca
parent325b988ca86d269655ab96dc7fadfc633052c25c (diff)
downloadpytest-284fd45a086f3943b616fed1e608a3109d372c3b.tar.gz
py36+: miscellaneous (3, 6) cleanup
-rw-r--r--doc/en/skipping.rst2
-rw-r--r--src/_pytest/capture.py6
-rw-r--r--src/_pytest/compat.py4
-rw-r--r--testing/acceptance_test.py3
-rw-r--r--testing/test_capture.py3
-rw-r--r--testing/test_compat.py4
6 files changed, 4 insertions, 18 deletions
diff --git a/doc/en/skipping.rst b/doc/en/skipping.rst
index 5c67d77a7..c463f3293 100644
--- a/doc/en/skipping.rst
+++ b/doc/en/skipping.rst
@@ -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():
...
diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py
index 2d2b392ab..629e3c09f 100644
--- a/src/_pytest/capture.py
+++ b/src/_pytest/capture.py
@@ -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).
diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py
index 33221aac2..4bb616785 100644
--- a/src/_pytest/compat.py
+++ b/src/_pytest/compat.py
@@ -97,9 +97,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:
diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py
index 039d8dad9..01fe97d4f 100644
--- a/testing/acceptance_test.py
+++ b/testing/acceptance_test.py
@@ -1183,9 +1183,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="""
diff --git a/testing/test_capture.py b/testing/test_capture.py
index 5f820d846..317a59227 100644
--- a/testing/test_capture.py
+++ b/testing/test_capture.py
@@ -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:
"""
diff --git a/testing/test_compat.py b/testing/test_compat.py
index 5debe87a3..34c8495d2 100644
--- a/testing/test_compat.py
+++ b/testing/test_compat.py
@@ -1,5 +1,4 @@
import enum
-import sys
from functools import partial
from functools import wraps
from typing import Union
@@ -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(
"""