Skip to content

Commit c9bb4c4

Browse files
fixup! Rename variables 'tmpdir'->'tmp_path'
* Add some more of these * Also reintroduce+rename instances of fixture usages that were 'tmpdir'->'tmp_path'
1 parent 09d4c5e commit c9bb4c4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

testing/python/collect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def test_function_as_object_instance_ignored(self, pytester: Pytester) -> None:
274274
pytester.makepyfile(
275275
"""
276276
class A(object):
277-
def __call__(self):
277+
def __call__(self, tmp_path):
278278
0/0
279279
280280
test_a = A()

testing/python/integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def mock_basename(path):
234234
@mock.patch("os.path.abspath")
235235
@mock.patch("os.path.normpath")
236236
@mock.patch("os.path.basename", new=mock_basename)
237-
def test_someting(normpath, abspath):
237+
def test_someting(normpath, abspath, tmp_path):
238238
abspath.return_value = "this"
239239
os.path.normpath(os.path.abspath("hello"))
240240
normpath.assert_any_call("this")

testing/test_conftest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ class TestConftestValueAccessGlobal:
4444
def basedir(
4545
self, request, tmp_path_factory: TempPathFactory
4646
) -> Generator[Path, None, None]:
47-
tmpdir = tmp_path_factory.mktemp("basedir", numbered=True)
48-
tmpdir.joinpath("adir/b").mkdir(parents=True)
49-
tmpdir.joinpath("adir/conftest.py").write_text("a=1 ; Directory = 3")
50-
tmpdir.joinpath("adir/b/conftest.py").write_text("b=2 ; a = 1.5")
47+
tmp_path = tmp_path_factory.mktemp("basedir", numbered=True)
48+
tmp_path.joinpath("adir/b").mkdir(parents=True)
49+
tmp_path.joinpath("adir/conftest.py").write_text("a=1 ; Directory = 3")
50+
tmp_path.joinpath("adir/b/conftest.py").write_text("b=2 ; a = 1.5")
5151
if request.param == "inpackage":
52-
tmpdir.joinpath("adir/__init__.py").touch()
53-
tmpdir.joinpath("adir/b/__init__.py").touch()
52+
tmp_path.joinpath("adir/__init__.py").touch()
53+
tmp_path.joinpath("adir/b/__init__.py").touch()
5454

55-
yield tmpdir
55+
yield tmp_path
5656

5757
def test_basic_init(self, basedir: Path) -> None:
5858
conftest = PytestPluginManager()

0 commit comments

Comments
 (0)