Skip to content

Commit

Permalink
Merge pull request #7832 from asottile/py36_pathlib2
Browse files Browse the repository at this point in the history
py36+: remove pathlib2 compatibility shim
  • Loading branch information
asottile committed Oct 3, 2020
2 parents 325b988 + 3c93eb0 commit 7836c2c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 15 deletions.
4 changes: 0 additions & 4 deletions doc/en/builtin.rst
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/en/tmpdir.rst
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions src/_pytest/pathlib.py
Expand Up @@ -14,6 +14,8 @@
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
Expand All @@ -30,11 +32,6 @@
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"]


Expand Down
4 changes: 0 additions & 4 deletions src/_pytest/tmpdir.py
Expand Up @@ -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)

0 comments on commit 7836c2c

Please sign in to comment.