summaryrefslogtreecommitdiff
path: root/tests/mixins.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2023-01-03 06:30:43 -0500
committerNed Batchelder <ned@nedbatchelder.com>2023-01-03 06:44:38 -0500
commitc3ee30c1cfd133f1e36a4a8992b531a0dc7ec5a9 (patch)
treef97bb81c7bc66e9cccad8a28cf1e57d2ceeeb347 /tests/mixins.py
parent0b05b45e342813b34d906e840e253a06b37133ae (diff)
downloadpython-coveragepy-git-c3ee30c1cfd133f1e36a4a8992b531a0dc7ec5a9.tar.gz
refactor(test): use tmp_path instead of tmpdir
Diffstat (limited to 'tests/mixins.py')
-rw-r--r--tests/mixins.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/mixins.py b/tests/mixins.py
index 7f246299..0f578637 100644
--- a/tests/mixins.py
+++ b/tests/mixins.py
@@ -12,7 +12,7 @@ import os
import os.path
import sys
-from typing import Tuple
+from typing import Iterator, Tuple
import pytest
@@ -57,10 +57,10 @@ class TempDirMixin:
run_in_temp_dir = True
@pytest.fixture(autouse=True)
- def _temp_dir(self, tmpdir_factory):
+ def _temp_dir(self, tmp_path_factory: pytest.TempPathFactory) -> Iterator[None]:
"""Create a temp dir for the tests, if they want it."""
if self.run_in_temp_dir:
- tmpdir = tmpdir_factory.mktemp("t")
+ tmpdir = tmp_path_factory.mktemp("t")
self.temp_dir = str(tmpdir)
with change_dir(self.temp_dir):
# Modules should be importable from this temp directory. We don't