@pytest.fixture
def redirect_webengine_data(data_tmpdir, monkeypatch):
 monkeypatch.setenv('XDG_DATA_HOME', str(data_tmpdir))
 monkeypatch.setenv('HOME', str(data_tmpdir))

@ pytest . fixture def redirect_webengine_data ( data_tmpdir , monkeypatch ) : monkeypatch . setenv ( 'XDG_DATA_HOME' , str ( data_tmpdir ) ) monkeypatch . setenv ( 'HOME' , str ( data_tmpdir ) )
set xdg_data_home and home to a temp location .