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

Replace tmpdir with tmp_path #49

Merged
merged 3 commits into from
Oct 17, 2022
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
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
pytest-datadir
==============

1.4.1 (UNRELEASED)
------------------
- Replace usage of ``tmpdir`` by ``tmp_path`` (`#48 <https://github.com/gabrielcnr/pytest-datadir/pull/48>`__).


1.4.0 (2022-01-18)
------------------

Expand Down
8 changes: 4 additions & 4 deletions src/pytest_datadir/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def _win32_longpath(path):


@pytest.fixture
def shared_datadir(request, tmpdir):
def shared_datadir(request, tmp_path):
original_shared_path = os.path.join(request.fspath.dirname, "data")
temp_path = Path(str(tmpdir.join("data")))
temp_path = tmp_path / "data"
shutil.copytree(
_win32_longpath(original_shared_path), _win32_longpath(str(temp_path))
)
Expand All @@ -37,8 +37,8 @@ def original_datadir(request):


@pytest.fixture
def datadir(original_datadir, tmpdir):
result = Path(str(tmpdir.join(original_datadir.stem)))
def datadir(original_datadir, tmp_path):
result = tmp_path / original_datadir.stem
if original_datadir.is_dir():
shutil.copytree(
_win32_longpath(str(original_datadir)), _win32_longpath(str(result))
Expand Down