There's something really wrong in pytest-tempdir logic. It seems that if I clone a project into /tmp/foo and then run pytest, pytest-tempdir removes the whole clone (!). $ cd /tmp $ git clone https://github.com/davidhalter/parso $ cd parso $ pytest Removing stale tempdir: /tmp/parso ========================================================= test session starts ========================================================= platform linux -- Python 3.10.0rc1, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 tempdir: /tmp/parso rootdir: /tmp/parso, configfile: pytest.ini, testpaths: parso, test plugins: tempdir-2019.10.12 collected 0 items ======================================================== no tests ran in 0.00s ======================================================== ERROR: file or directory not found: parso