From 2d19708a419fff804e6395ba9d7041818ef80345 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 19 Apr 2015 17:11:29 -0300 Subject: [PATCH] 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. --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index cf34f75d5..892a91912 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -107,7 +107,7 @@ def pytest_collection_modifyitems(items): http://pytest.org/latest/plugins.html """ for item in items: - if 'qtbot' in item.fixturenames: + if 'qtbot' in getattr(item, 'fixturenames', ()): item.add_marker('gui')