Skip to content

Commit 7836c2c

Browse files
authored
Merge pull request #7832 from asottile/py36_pathlib2
py36+: remove pathlib2 compatibility shim
2 parents 325b988 + 3c93eb0 commit 7836c2c

File tree

5 files changed

+3
-15
lines changed

5 files changed

+3
-15
lines changed

doc/en/builtin.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
169169
170170
The returned object is a :class:`pathlib.Path` object.
171171
172-
.. note::
173-
174-
In python < 3.6 this is a pathlib2.Path.
175-
176172
177173
no tests ran in 0.12s
178174

doc/en/tmpdir.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can use the ``tmp_path`` fixture which will
1515
provide a temporary directory unique to the test invocation,
1616
created in the `base temporary directory`_.
1717

18-
``tmp_path`` is a ``pathlib/pathlib2.Path`` object. Here is an example test usage:
18+
``tmp_path`` is a ``pathlib.Path`` object. Here is an example test usage:
1919

2020
.. code-block:: python
2121

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ install_requires =
4848
atomicwrites>=1.0;sys_platform=="win32"
4949
colorama;sys_platform=="win32"
5050
importlib-metadata>=0.12;python_version<"3.8"
51-
pathlib2>=2.2.0;python_version<"3.6"
5251
python_requires = >=3.6
5352
package_dir =
5453
=src

src/_pytest/pathlib.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from os.path import expandvars
1515
from os.path import isabs
1616
from os.path import sep
17+
from pathlib import Path
18+
from pathlib import PurePath
1719
from posixpath import sep as posix_sep
1820
from types import ModuleType
1921
from typing import Callable
@@ -30,11 +32,6 @@
3032
from _pytest.outcomes import skip
3133
from _pytest.warning_types import PytestWarning
3234

33-
if sys.version_info[:2] >= (3, 6):
34-
from pathlib import Path, PurePath
35-
else:
36-
from pathlib2 import Path, PurePath
37-
3835
__all__ = ["Path", "PurePath"]
3936

4037

src/_pytest/tmpdir.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ def tmp_path(request: FixtureRequest, tmp_path_factory: TempPathFactory) -> Path
190190
directory.
191191
192192
The returned object is a :class:`pathlib.Path` object.
193-
194-
.. note::
195-
196-
In python < 3.6 this is a pathlib2.Path.
197193
"""
198194

199195
return _mk_tmp(request, tmp_path_factory)

0 commit comments

Comments
 (0)