get PYTEST_ADDOPTS before calling _initini

This commit is contained in:
Dirk Thomas 2017-10-10 07:56:46 -07:00
parent 1480aed781
commit 66e9a79472
1 changed files with 2 additions and 1 deletions

View File

@ -1055,9 +1055,10 @@ class Config(object):
"(are you using python -O?)\n")
def _preparse(self, args, addopts=True):
self._initini(args)
if addopts:
args[:] = shlex.split(os.environ.get('PYTEST_ADDOPTS', '')) + args
self._initini(args)
if addopts:
args[:] = self.getini("addopts") + args
self._checkversion()
self._consider_importhook(args)