Skip to content

Commit

Permalink
make custom cache dir a subfolder of testdir
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Oct 11, 2017
1 parent a5385fb commit cfd928c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,9 @@ def test_with_existing_file_in_subdir(self, tmpdir):
assert inifile is None

def test_addopts_before_initini(self, testdir, tmpdir, monkeypatch):
monkeypatch.setenv('PYTEST_ADDOPTS', '-o cache_dir=/somewhere')
cache_dir = testdir.tmpdir.join('.custom_cache')
monkeypatch.setenv('PYTEST_ADDOPTS', '-o cache_dir=%s' % cache_dir)
from _pytest.config import get_config
config = get_config()
config._preparse([], addopts=True)
assert config._override_ini == [['cache_dir=/somewhere']]
assert config._override_ini == [['cache_dir=%s' % cache_dir]]

0 comments on commit cfd928c

Please sign in to comment.