diff options
author | Jay Kamat <jaygkamat@gmail.com> | 2019-04-18 23:18:00 -0700 |
---|---|---|
committer | Jay Kamat <jaygkamat@gmail.com> | 2019-07-03 17:37:13 -0700 |
commit | f35eba0d60b0150c3a1fdf6352a958d0882b3286 (patch) | |
tree | 3a207f26ee168e769243b30b82dce791733844d3 /tests/helpers/fixtures.py | |
parent | 974d762e286c8c2596ad956d54166f0c397b3ac5 (diff) | |
download | qutebrowser-f35eba0d60b0150c3a1fdf6352a958d0882b3286.tar.gz qutebrowser-f35eba0d60b0150c3a1fdf6352a958d0882b3286.zip |
Use standarddir for config.py override
Also, make config-source, config-write-py, and config-edit honor
config argument
Diffstat (limited to 'tests/helpers/fixtures.py')
-rw-r--r-- | tests/helpers/fixtures.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py index f993cbf19..ef4a4d2f3 100644 --- a/tests/helpers/fixtures.py +++ b/tests/helpers/fixtures.py @@ -536,10 +536,23 @@ def config_tmpdir(monkeypatch, tmpdir): Use this to avoid creating a 'real' config dir (~/.config/qute_test). """ + monkeypatch.setattr( + standarddir, 'config_py', + lambda **_kwargs: str(tmpdir / 'config' / 'config.py')) return standarddir_tmpdir('config', monkeypatch, tmpdir) @pytest.fixture +def config_py_arg(tmpdir, monkeypatch): + """Arguments needed for the config to init.""" + f = tmpdir.join('temp_config.py') + monkeypatch.setattr( + standarddir, 'config_py', + lambda **_kwargs: str(f)) + return f + + +@pytest.fixture def data_tmpdir(monkeypatch, tmpdir): """Set tmpdir/data as the datadir. |