extended - fix issue214 - ignore attribute-access errors with objects in test modules that can blow up (for example flask's request object)

This commit is contained in:
holger krekel
2012-10-31 17:00:55 +01:00
parent 983b2d2475
commit fb173a97a8
6 changed files with 30 additions and 41 deletions

View File

@@ -1,2 +1,2 @@
#
__version__ = '2.3.2'
__version__ = '2.3.3.dev1'

View File

@@ -1552,12 +1552,12 @@ class FixtureManager:
# fixture functions have a pytest_funcarg__ prefix (pre-2.3 style)
# or are "@pytest.fixture" marked
try:
marker = getattr(obj, "_pytestfixturefunction", None)
except RuntimeError:
# some proxy objects raise RuntimeError
# flasks request globals are one example
# those aren't fixture functions, so we can ignore
# XXX: maybe trace it when it happens?
marker = obj._pytestfixturefunction
except KeyboardInterrupt:
raise
except Exception:
# some objects raise errors like request (from flask import request)
# we don't expect them to be fixture functions
marker = None
if marker is None: