Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py36+: remove pathlib2 compatibility shim #7832

Merged
merged 1 commit into from Oct 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)