You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using a basetemp in the test collection source directory and adding valid, failing pytests to it the tests are collected before the basetemp directory is ensure_reset_dir'd
deftest_basetemp_not_collected(testdir):
testdir.makepyfile(
r""" def test(tmp_path): (tmp_path / "test_fail.py").write_text( "def test_fail():\n assert False" ) """
)
asserttestdir.runpytest("--basetemp=tmp").ret==0# running a second time and ensure we don't crashasserttestdir.runpytest("--basetemp=tmp").ret==0
deftest_basetemp_not_collected(testdir):
testdir.makepyfile(
r""" def test(tmp_path): (tmp_path / "test_fail.py").write_text( "def test_fail():\n assert False" ) """
)
asserttestdir.runpytest("--basetemp=tmp1").ret==0# running a second time and ensure we don't crashasserttestdir.runpytest("--basetemp=tmp2").ret==0
secondly, what should happen if the basetemp is different between runs? Should pytest clean basetemp after the run?
should pytest add a .pytest-basetemp sentinel file for collect to ignore?
Activity
graingert commentedon Oct 26, 2020
@RonnyPfannschmidt should collect call
TempPathFactory.getbasetemp(and rm_rf the tmp dir) or should it be excluded by default?graingert commentedon Oct 26, 2020
secondly, what should happen if the basetemp is different between runs? Should pytest clean basetemp after the run?
should pytest add a
.pytest-basetempsentinel file for collect to ignore?RonnyPfannschmidt commentedon Oct 27, 2020
I'd leave ignoring basetmp to the user