Merge pull request #2142 from barneygale/xfail_without_condition_getglobals

'xfail' markers without a condition no longer rely on the underlying `Item` objects deriving from `PyobjMixin`
This commit is contained in:
Bruno Oliveira 2017-02-03 16:09:47 -02:00 committed by GitHub
commit a4d2a5785b
3 changed files with 7 additions and 2 deletions

View File

@ -16,6 +16,7 @@ Antony Lee
Armin Rigo
Aron Curzon
Aviv Palivoda
Barney Gale
Ben Webb
Benjamin Peterson
Bernard Pratz

View File

@ -8,7 +8,10 @@
*
*
* Conditionless ``xfail`` markers no longer rely on the underlying test item
being an instance of ``PyobjMixin``, and can therefore apply to tests not
collected by the built-in python test collector. Thanks `@barneygale`_ for the
PR.
*
@ -49,6 +52,7 @@
terminal output it relies on is missing. Thanks to `@eli-b`_ for the PR.
.. _@barneygale: https://github.com/barneygale
.. _@lesteve: https://github.com/lesteve
.. _@malinoff: https://github.com/malinoff
.. _@pelme: https://github.com/pelme

View File

@ -119,7 +119,6 @@ class MarkEvaluator:
if hasattr(self, 'result'):
return self.result
if self.holder:
d = self._getglobals()
if self.holder.args or 'condition' in self.holder.kwargs:
self.result = False
# "holder" might be a MarkInfo or a MarkDecorator; only
@ -135,6 +134,7 @@ class MarkEvaluator:
for expr in args:
self.expr = expr
if isinstance(expr, py.builtin._basestring):
d = self._getglobals()
result = cached_eval(self.item.config, expr, d)
else:
if "reason" not in kwargs: