fixup! Rename variables 'tmpdir'->'tmp_path'

* Add some more of these
* Also reintroduce+rename instances of fixture usages that were
'tmpdir'->'tmp_path'
This commit is contained in:
Matthew Hughes 2021-02-21 13:10:00 +00:00
parent 09d4c5e30a
commit c9bb4c418f
3 changed files with 9 additions and 9 deletions

View File

@ -274,7 +274,7 @@ class TestFunction:
pytester.makepyfile(
"""
class A(object):
def __call__(self):
def __call__(self, tmp_path):
0/0
test_a = A()

View File

@ -234,7 +234,7 @@ class TestMockDecoration:
@mock.patch("os.path.abspath")
@mock.patch("os.path.normpath")
@mock.patch("os.path.basename", new=mock_basename)
def test_someting(normpath, abspath):
def test_someting(normpath, abspath, tmp_path):
abspath.return_value = "this"
os.path.normpath(os.path.abspath("hello"))
normpath.assert_any_call("this")

View File

@ -44,15 +44,15 @@ class TestConftestValueAccessGlobal:
def basedir(
self, request, tmp_path_factory: TempPathFactory
) -> Generator[Path, None, None]:
tmpdir = tmp_path_factory.mktemp("basedir", numbered=True)
tmpdir.joinpath("adir/b").mkdir(parents=True)
tmpdir.joinpath("adir/conftest.py").write_text("a=1 ; Directory = 3")
tmpdir.joinpath("adir/b/conftest.py").write_text("b=2 ; a = 1.5")
tmp_path = tmp_path_factory.mktemp("basedir", numbered=True)
tmp_path.joinpath("adir/b").mkdir(parents=True)
tmp_path.joinpath("adir/conftest.py").write_text("a=1 ; Directory = 3")
tmp_path.joinpath("adir/b/conftest.py").write_text("b=2 ; a = 1.5")
if request.param == "inpackage":
tmpdir.joinpath("adir/__init__.py").touch()
tmpdir.joinpath("adir/b/__init__.py").touch()
tmp_path.joinpath("adir/__init__.py").touch()
tmp_path.joinpath("adir/b/__init__.py").touch()
yield tmpdir
yield tmp_path
def test_basic_init(self, basedir: Path) -> None:
conftest = PytestPluginManager()