From 10a3b9118b70ae287b32c218d89a5a5e0c145127 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 11 Oct 2017 19:37:17 -0300 Subject: [PATCH] Use a relative cache_dir in test because of how arguments are parsed 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 --- testing/test_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_config.py b/testing/test_config.py index 93b288215..9881a5d41 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -845,7 +845,7 @@ class TestOverrideIniArgs(object): 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()