@pytest.fixture
def data_tmpdir(monkeypatch, tmpdir):
 datadir = (tmpdir / 'data')
 path = str(datadir)
 os.mkdir(path)
 monkeypatch.setattr('qutebrowser.utils.standarddir.data', (lambda : path))
 return datadir

@ pytest . fixture def data_tmpdir ( monkeypatch , tmpdir ) : datadir = ( tmpdir / 'data' ) path = str ( datadir ) os . mkdir ( path ) monkeypatch . setattr ( 'qutebrowser.utils.standarddir.data' , ( lambda : path ) ) return datadir
set tmpdir/data as the datadir .