Skip to content

Commit

Permalink
Use a relative cache_dir in test because of how arguments are parsed …
Browse files Browse the repository at this point in the history
…on Windows

We use shlex to parse command-line arguments and PYTEST_ADDOPTS, so passing
a full path with '\' arguments produces incorrect results on Windows

Anyway users are advised to use relative paths for portability
  • Loading branch information
nicoddemus committed Oct 11, 2017
1 parent ce8c829 commit 10a3b91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ def test_with_existing_file_in_subdir(self, tmpdir):
assert inifile is None

def test_addopts_before_initini(self, testdir, tmpdir, monkeypatch):
cache_dir = testdir.tmpdir.join('.custom_cache')
cache_dir = '.custom_cache'
monkeypatch.setenv('PYTEST_ADDOPTS', '-o cache_dir=%s' % cache_dir)
from _pytest.config import get_config
config = get_config()
Expand Down

0 comments on commit 10a3b91

Please sign in to comment.