@pytest.fixture(autouse=True)def_docdir(request,tmp_path):# Trigger ONLY for the doctests.doctest_plugin=request.config.pluginmanager.getplugin('doctest')ifisinstance(request.node,doctest_plugin.DoctestItem):copytree(Path(__file__).parent/'tests'/'data',tmp_path,dirs_exist_ok=True)# Chdir only for the duration of the test.with_chdir(tmp_path):yieldelse:# For normal tests, we have to yield, since this is a yield-fixture.yield