Skip to content

Commit

Permalink
add test for pytest-dev#2824
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas authored and ceridwen committed Oct 19, 2017
1 parent 30716b3 commit 4aed72e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,3 +843,11 @@ def test_with_existing_file_in_subdir(self, tmpdir):
rootdir, inifile, inicfg = determine_setup(None, ['a/exist'])
assert rootdir == tmpdir
assert inifile is None

def test_addopts_before_initini(self, testdir, tmpdir, monkeypatch):
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=%s' % cache_dir]]

0 comments on commit 4aed72e

Please sign in to comment.