merge with upstream
--HG-- branch : parametrized-fixture-override
This commit is contained in:
commit
16bcfa749e
2
Makefile
2
Makefile
|
@ -6,7 +6,7 @@ PYTHON = python2.7
|
||||||
|
|
||||||
# install all needed for development
|
# install all needed for development
|
||||||
develop: .env
|
develop: .env
|
||||||
.env/bin/pip install -e .[test] tox
|
.env/bin/pip install -e . tox
|
||||||
|
|
||||||
# clean the development envrironment
|
# clean the development envrironment
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1712,9 +1712,8 @@ class FixtureManager:
|
||||||
def pytest_generate_tests(self, metafunc):
|
def pytest_generate_tests(self, metafunc):
|
||||||
for argname in metafunc.fixturenames:
|
for argname in metafunc.fixturenames:
|
||||||
faclist = metafunc._arg2fixturedefs.get(argname)
|
faclist = metafunc._arg2fixturedefs.get(argname)
|
||||||
if faclist is None:
|
if faclist:
|
||||||
continue # will raise FixtureLookupError at setup time
|
fixturedef = faclist[-1]
|
||||||
for fixturedef in faclist[-1:]:
|
|
||||||
if fixturedef.params is not None:
|
if fixturedef.params is not None:
|
||||||
func_params = getattr(getattr(metafunc.function, 'parametrize', None), 'args', [[None]])
|
func_params = getattr(getattr(metafunc.function, 'parametrize', None), 'args', [[None]])
|
||||||
# skip directly parametrized arguments
|
# skip directly parametrized arguments
|
||||||
|
@ -1722,6 +1721,8 @@ class FixtureManager:
|
||||||
metafunc.parametrize(argname, fixturedef.params,
|
metafunc.parametrize(argname, fixturedef.params,
|
||||||
indirect=True, scope=fixturedef.scope,
|
indirect=True, scope=fixturedef.scope,
|
||||||
ids=fixturedef.ids)
|
ids=fixturedef.ids)
|
||||||
|
else:
|
||||||
|
continue # will raise FixtureLookupError at setup time
|
||||||
|
|
||||||
def pytest_collection_modifyitems(self, items):
|
def pytest_collection_modifyitems(self, items):
|
||||||
# separate parametrized setups
|
# separate parametrized setups
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -136,7 +136,7 @@ commands=
|
||||||
minversion=2.0
|
minversion=2.0
|
||||||
plugins=pytester
|
plugins=pytester
|
||||||
#--pyargs --doctest-modules --ignore=.tox
|
#--pyargs --doctest-modules --ignore=.tox
|
||||||
addopts= -rxsX
|
addopts= -rxsX -vl
|
||||||
rsyncdirs=tox.ini pytest.py _pytest testing
|
rsyncdirs=tox.ini pytest.py _pytest testing
|
||||||
python_files=test_*.py *_test.py testing/*/*.py
|
python_files=test_*.py *_test.py testing/*/*.py
|
||||||
python_classes=Test Acceptance
|
python_classes=Test Acceptance
|
||||||
|
|
Loading…
Reference in New Issue