diff --git a/_pytest/config.py b/_pytest/config.py index 0d9beb3d3..f4be2d062 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -705,8 +705,7 @@ class Config(object): def _preparse(self, args, addopts=True): self._initini(args) if addopts: - env_addopts = os.environ.get('PYTEST_ADDOPTS', '') - args[:] = env_addopts.replace('"', '').split() + args + args[:] = shlex.split(os.environ.get('PYTEST_ADDOPTS', '')) + args args[:] = self.getini("addopts") + args self._checkversion() self.pluginmanager.consider_preparse(args)