Play nice with other plugins in conftest.py
Some plugins might create their own Item subclasses without a `fixturenames` attribute. Discovered while taking pytest-flakes for a spin.
This commit is contained in:
parent
6c97a4a6e0
commit
2d19708a41
@ -107,7 +107,7 @@ def pytest_collection_modifyitems(items):
|
|||||||
http://pytest.org/latest/plugins.html
|
http://pytest.org/latest/plugins.html
|
||||||
"""
|
"""
|
||||||
for item in items:
|
for item in items:
|
||||||
if 'qtbot' in item.fixturenames:
|
if 'qtbot' in getattr(item, 'fixturenames', ()):
|
||||||
item.add_marker('gui')
|
item.add_marker('gui')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user