diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 0fd58164c..1d7fe76e3 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -169,10 +169,6 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a The returned object is a :class:`pathlib.Path` object. - .. note:: - - In python < 3.6 this is a pathlib2.Path. - no tests ran in 0.12s diff --git a/doc/en/tmpdir.rst b/doc/en/tmpdir.rst index 5f882b140..a0d5cc0de 100644 --- a/doc/en/tmpdir.rst +++ b/doc/en/tmpdir.rst @@ -15,7 +15,7 @@ You can use the ``tmp_path`` fixture which will provide a temporary directory unique to the test invocation, created in the `base temporary directory`_. -``tmp_path`` is a ``pathlib/pathlib2.Path`` object. Here is an example test usage: +``tmp_path`` is a ``pathlib.Path`` object. Here is an example test usage: .. code-block:: python diff --git a/setup.cfg b/setup.cfg index 64c64a607..28ec061e0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -48,7 +48,6 @@ install_requires = atomicwrites>=1.0;sys_platform=="win32" colorama;sys_platform=="win32" importlib-metadata>=0.12;python_version<"3.8" - pathlib2>=2.2.0;python_version<"3.6" python_requires = >=3.6 package_dir = =src diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index 355281039..7179a786d 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -14,6 +14,8 @@ from os.path import expanduser from os.path import expandvars from os.path import isabs from os.path import sep +from pathlib import Path +from pathlib import PurePath from posixpath import sep as posix_sep from types import ModuleType from typing import Callable @@ -30,11 +32,6 @@ from _pytest.compat import assert_never from _pytest.outcomes import skip from _pytest.warning_types import PytestWarning -if sys.version_info[:2] >= (3, 6): - from pathlib import Path, PurePath -else: - from pathlib2 import Path, PurePath - __all__ = ["Path", "PurePath"] diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index eb8aa9f91..06bd764d4 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -190,10 +190,6 @@ def tmp_path(request: FixtureRequest, tmp_path_factory: TempPathFactory) -> Path directory. The returned object is a :class:`pathlib.Path` object. - - .. note:: - - In python < 3.6 this is a pathlib2.Path. """ return _mk_tmp(request, tmp_path_factory)