Skip to content

Commit f453460

Browse files
authored
Merge pull request #7912 from hugovk/rm-3.5
2 parents f61d4ed + c9e5042 commit f453460

File tree

10 files changed

+19
-60
lines changed

10 files changed

+19
-60
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Features
8989
- Can run `unittest <https://docs.pytest.org/en/stable/unittest.html>`_ (or trial),
9090
`nose <https://docs.pytest.org/en/stable/nose.html>`_ test suites out of the box
9191

92-
- Python 3.5+ and PyPy3
92+
- Python 3.6+ and PyPy3
9393

9494
- Rich plugin architecture, with over 850+ `external plugins <http://plugincompat.herokuapp.com>`_ and thriving community
9595

doc/en/getting-started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Installation and Getting Started
22
===================================
33

4-
**Pythons**: Python 3.5, 3.6, 3.7, 3.8, 3.9, PyPy3
4+
**Pythons**: Python 3.6, 3.7, 3.8, 3.9, PyPy3
55

66
**Platforms**: Linux and Windows
77

doc/en/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Features
6969

7070
- Can run :ref:`unittest <unittest>` (including trial) and :ref:`nose <noseintegration>` test suites out of the box
7171

72-
- Python 3.5+ and PyPy 3
72+
- Python 3.6+ and PyPy 3
7373

7474
- Rich plugin architecture, with over 315+ `external plugins <http://plugincompat.herokuapp.com>`_ and thriving community
7575

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ filterwarnings = [
2929
"ignore:.*U.*mode is deprecated:DeprecationWarning:(?!(pytest|_pytest))",
3030
# produced by pytest-xdist
3131
"ignore:.*type argument to addoption.*:DeprecationWarning",
32-
# produced by python >=3.5 on execnet (pytest-xdist)
32+
# produced on execnet (pytest-xdist)
3333
"ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning",
3434
# pytest's own futurewarnings
3535
"ignore::pytest.PytestExperimentalApiWarning",

src/_pytest/assertion/rewrite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def find_spec(
9999
spec is None
100100
# this is a namespace package (without `__init__.py`)
101101
# there's nothing to rewrite there
102-
# python3.5 - python3.6: `namespace`
102+
# python3.6: `namespace`
103103
# python3.7+: `None`
104104
or spec.origin == "namespace"
105105
or spec.origin is None
@@ -1005,7 +1005,7 @@ def visit_Call(self, call: ast.Call) -> Tuple[ast.Name, str]:
10051005
return res, outer_expl
10061006

10071007
def visit_Starred(self, starred: ast.Starred) -> Tuple[ast.Starred, str]:
1008-
# From Python 3.5, a Starred node can appear in a function call.
1008+
# A Starred node can appear in a function call.
10091009
res, expl = self.visit(starred.value)
10101010
new_starred = ast.Starred(res, starred.ctx)
10111011
return new_starred, "*" + expl

src/_pytest/capture.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,7 @@ def writeorg(self, data):
497497
class CaptureResult(Generic[AnyStr]):
498498
"""The result of :method:`CaptureFixture.readouterr`."""
499499

500-
# Can't use slots in Python<3.5.3 due to https://bugs.python.org/issue31272
501-
if sys.version_info >= (3, 5, 3):
502-
__slots__ = ("out", "err")
500+
__slots__ = ("out", "err")
503501

504502
def __init__(self, out: AnyStr, err: AnyStr) -> None:
505503
self.out: AnyStr = out

src/_pytest/python_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase:
443443
both ``a`` and ``b``, this test is symmetric (i.e. neither ``a`` nor
444444
``b`` is a "reference value"). You have to specify an absolute tolerance
445445
if you want to compare to ``0.0`` because there is no tolerance by
446-
default. Only available in python>=3.5. `More information...`__
446+
default. `More information...`__
447447
448448
__ https://docs.python.org/3/library/math.html#math.isclose
449449

testing/code/test_excinfo.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import importlib
12
import io
23
import operator
34
import os
@@ -20,13 +21,6 @@
2021
from _pytest._io import TerminalWriter
2122
from _pytest.pytester import LineMatcher
2223

23-
try:
24-
import importlib
25-
except ImportError:
26-
invalidate_import_caches = None
27-
else:
28-
invalidate_import_caches = getattr(importlib, "invalidate_caches", None)
29-
3024
if TYPE_CHECKING:
3125
from _pytest._code.code import _TracebackStyle
3226

@@ -445,8 +439,7 @@ def importasmod(source):
445439
modpath = tmpdir.join("mod.py")
446440
tmpdir.ensure("__init__.py")
447441
modpath.write(source)
448-
if invalidate_import_caches is not None:
449-
invalidate_import_caches()
442+
importlib.invalidate_caches()
450443
return modpath.pyimport()
451444

452445
return importasmod

testing/python/raises.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,6 @@ def test_raises_cyclic_reference(self, method):
162162

163163
class T:
164164
def __call__(self):
165-
# Early versions of Python 3.5 have some bug causing the
166-
# __call__ frame to still refer to t even after everything
167-
# is done. This makes the test pass for them.
168-
if sys.version_info < (3, 5, 2):
169-
del self
170165
raise ValueError
171166

172167
t = T()

testing/test_reports.py

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from pathlib import Path
32
from typing import Sequence
43
from typing import Union
@@ -346,44 +345,18 @@ def test_chained_exceptions_no_reprcrash(self, testdir: Testdir, tw_mock) -> Non
346345
from subprocess to main process creates an artificial exception, which ExceptionInfo
347346
can't obtain the ReprFileLocation from.
348347
"""
349-
# somehow in Python 3.5 on Windows this test fails with:
350-
# File "c:\...\3.5.4\x64\Lib\multiprocessing\connection.py", line 302, in _recv_bytes
351-
# overlapped=True)
352-
# OSError: [WinError 6] The handle is invalid
353-
#
354-
# so in this platform we opted to use a mock traceback which is identical to the
355-
# one produced by the multiprocessing module
356-
if sys.version_info[:2] <= (3, 5) and sys.platform.startswith("win"):
357-
testdir.makepyfile(
358-
"""
359-
# equivalent of multiprocessing.pool.RemoteTraceback
360-
class RemoteTraceback(Exception):
361-
def __init__(self, tb):
362-
self.tb = tb
363-
def __str__(self):
364-
return self.tb
365-
def test_a():
366-
try:
367-
raise ValueError('value error')
368-
except ValueError as e:
369-
# equivalent to how multiprocessing.pool.rebuild_exc does it
370-
e.__cause__ = RemoteTraceback('runtime error')
371-
raise e
348+
testdir.makepyfile(
372349
"""
373-
)
374-
else:
375-
testdir.makepyfile(
376-
"""
377-
from concurrent.futures import ProcessPoolExecutor
350+
from concurrent.futures import ProcessPoolExecutor
378351
379-
def func():
380-
raise ValueError('value error')
352+
def func():
353+
raise ValueError('value error')
381354
382-
def test_a():
383-
with ProcessPoolExecutor() as p:
384-
p.submit(func).result()
385-
"""
386-
)
355+
def test_a():
356+
with ProcessPoolExecutor() as p:
357+
p.submit(func).result()
358+
"""
359+
)
387360

388361
testdir.syspathinsert()
389362
reprec = testdir.inline_run()

0 commit comments

Comments
 (0)