fix #4680 - ensure tmpdir and tmp_path are the same
This commit is contained in:
parent
9905a73ae0
commit
f7d7555521
|
@ -0,0 +1 @@
|
||||||
|
Ensure the ``tmpdir`` and the ``tmp_path`` fixtures are the same folder.
|
|
@ -167,7 +167,7 @@ def _mk_tmp(request, factory):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def tmpdir(request, tmpdir_factory):
|
def tmpdir(tmp_path):
|
||||||
"""Return a temporary directory path object
|
"""Return a temporary directory path object
|
||||||
which is unique to each test function invocation,
|
which is unique to each test function invocation,
|
||||||
created as a sub directory of the base temporary
|
created as a sub directory of the base temporary
|
||||||
|
@ -176,7 +176,7 @@ def tmpdir(request, tmpdir_factory):
|
||||||
|
|
||||||
.. _`py.path.local`: https://py.readthedocs.io/en/latest/path.html
|
.. _`py.path.local`: https://py.readthedocs.io/en/latest/path.html
|
||||||
"""
|
"""
|
||||||
return _mk_tmp(request, tmpdir_factory)
|
return py.path.local(tmp_path)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
|
@ -337,3 +337,7 @@ def attempt_symlink_to(path, to_path):
|
||||||
Path(path).symlink_to(Path(to_path))
|
Path(path).symlink_to(Path(to_path))
|
||||||
except OSError:
|
except OSError:
|
||||||
pytest.skip("could not create symbolic link")
|
pytest.skip("could not create symbolic link")
|
||||||
|
|
||||||
|
|
||||||
|
def test_tmpdir_equals_tmp_path(tmpdir, tmp_path):
|
||||||
|
assert Path(tmpdir) == tmp_path
|
||||||
|
|
Loading…
Reference in New Issue