@pytest.fixture
def modules_tmpdir(tmpdir, monkeypatch):
 rv = tmpdir.mkdir('modules_tmpdir')
 monkeypatch.syspath_prepend(str(rv))
 return rv

@ pytest . fixture def modules_tmpdir ( tmpdir , monkeypatch ) : rv = tmpdir . mkdir ( 'modules_tmpdir' ) monkeypatch . syspath_prepend ( str ( rv ) ) return rv
a tmpdir added to sys .