File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,7 @@ def _prepareconfig(args=None, plugins=None):
104
104
elif not isinstance (args , (tuple , list )):
105
105
if not isinstance (args , str ):
106
106
raise ValueError ("not a string or argument list: %r" % (args ,))
107
- if sys .platform == "win32" :
108
- args = shlex .split (args , posix = False )
109
- else :
110
- args = shlex .split (args )
107
+ args = shlex .split (args , posix = sys .platform == "win32" )
111
108
config = get_config ()
112
109
pluginmanager = config .pluginmanager
113
110
try :
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ def test_confcutdir(self, testdir):
79
79
""" )
80
80
result = testdir .inline_run ("--confcutdir=." )
81
81
assert result .ret == 0
82
-
82
+
83
83
class TestConfigCmdlineParsing :
84
84
def test_parsing_again_fails (self , testdir ):
85
85
config = testdir .parseconfig ()
@@ -101,6 +101,16 @@ def pytest_addoption(parser):
101
101
config = testdir .parseconfig ("-c" , "custom.cfg" )
102
102
assert config .getini ("custom" ) == "1"
103
103
104
+ def test_absolute_win32_path (self , testdir ):
105
+ temp_cfg_file = testdir .makefile (".cfg" , custom = """
106
+ [pytest]
107
+ addopts = --version
108
+ """ )
109
+ from os .path import normpath
110
+ temp_cfg_file = normpath (str (temp_cfg_file ))
111
+ ret = pytest .main ("-c " + temp_cfg_file )
112
+ assert ret == _pytest .main .EXIT_OK
113
+
104
114
class TestConfigAPI :
105
115
def test_config_trace (self , testdir ):
106
116
config = testdir .parseconfig ()
You can’t perform that action at this time.
0 commit comments