Merge pull request #7832 from asottile/py36_pathlib2
py36+: remove pathlib2 compatibility shim
This commit is contained in:
commit
7836c2c371
|
@ -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.
|
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
|
no tests ran in 0.12s
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ You can use the ``tmp_path`` fixture which will
|
||||||
provide a temporary directory unique to the test invocation,
|
provide a temporary directory unique to the test invocation,
|
||||||
created in the `base temporary directory`_.
|
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
|
.. code-block:: python
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,6 @@ install_requires =
|
||||||
atomicwrites>=1.0;sys_platform=="win32"
|
atomicwrites>=1.0;sys_platform=="win32"
|
||||||
colorama;sys_platform=="win32"
|
colorama;sys_platform=="win32"
|
||||||
importlib-metadata>=0.12;python_version<"3.8"
|
importlib-metadata>=0.12;python_version<"3.8"
|
||||||
pathlib2>=2.2.0;python_version<"3.6"
|
|
||||||
python_requires = >=3.6
|
python_requires = >=3.6
|
||||||
package_dir =
|
package_dir =
|
||||||
=src
|
=src
|
||||||
|
|
|
@ -14,6 +14,8 @@ from os.path import expanduser
|
||||||
from os.path import expandvars
|
from os.path import expandvars
|
||||||
from os.path import isabs
|
from os.path import isabs
|
||||||
from os.path import sep
|
from os.path import sep
|
||||||
|
from pathlib import Path
|
||||||
|
from pathlib import PurePath
|
||||||
from posixpath import sep as posix_sep
|
from posixpath import sep as posix_sep
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
@ -30,11 +32,6 @@ from _pytest.compat import assert_never
|
||||||
from _pytest.outcomes import skip
|
from _pytest.outcomes import skip
|
||||||
from _pytest.warning_types import PytestWarning
|
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"]
|
__all__ = ["Path", "PurePath"]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -190,10 +190,6 @@ def tmp_path(request: FixtureRequest, tmp_path_factory: TempPathFactory) -> Path
|
||||||
directory.
|
directory.
|
||||||
|
|
||||||
The returned object is a :class:`pathlib.Path` object.
|
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)
|
return _mk_tmp(request, tmp_path_factory)
|
||||||
|
|
Loading…
Reference in New Issue