diff --git a/AUTHORS b/AUTHORS index 14bb4e3c1..7ae2b50d9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -87,3 +87,4 @@ Russel Winder Ben Webb Alexei Kozlenok Cal Leeming +Feng Ma diff --git a/_pytest/config.py b/_pytest/config.py index fb7b1774f..db5938b2a 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -104,7 +104,10 @@ def _prepareconfig(args=None, plugins=None): elif not isinstance(args, (tuple, list)): if not isinstance(args, str): raise ValueError("not a string or argument list: %r" % (args,)) - args = shlex.split(args) + if sys.platform == "win32": + args = shlex.split(args, posix=False) + else: + args = shlex.split(args) config = get_config() pluginmanager = config.pluginmanager try: