Use shlex to split the arguments from PYTEST_ADDOPTS.

--HG--
branch : env-addopts
This commit is contained in:
Dave Hunt 2015-01-26 10:39:21 +00:00
parent 7325a5fe2e
commit 8f12269db7
1 changed files with 1 additions and 2 deletions

View File

@ -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)