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:
commit
a4d2a5785b
1
AUTHORS
1
AUTHORS
|
@ -16,6 +16,7 @@ Antony Lee
|
||||||
Armin Rigo
|
Armin Rigo
|
||||||
Aron Curzon
|
Aron Curzon
|
||||||
Aviv Palivoda
|
Aviv Palivoda
|
||||||
|
Barney Gale
|
||||||
Ben Webb
|
Ben Webb
|
||||||
Benjamin Peterson
|
Benjamin Peterson
|
||||||
Bernard Pratz
|
Bernard Pratz
|
||||||
|
|
|
@ -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.
|
terminal output it relies on is missing. Thanks to `@eli-b`_ for the PR.
|
||||||
|
|
||||||
|
|
||||||
|
.. _@barneygale: https://github.com/barneygale
|
||||||
.. _@lesteve: https://github.com/lesteve
|
.. _@lesteve: https://github.com/lesteve
|
||||||
.. _@malinoff: https://github.com/malinoff
|
.. _@malinoff: https://github.com/malinoff
|
||||||
.. _@pelme: https://github.com/pelme
|
.. _@pelme: https://github.com/pelme
|
||||||
|
|
|
@ -119,7 +119,6 @@ class MarkEvaluator:
|
||||||
if hasattr(self, 'result'):
|
if hasattr(self, 'result'):
|
||||||
return self.result
|
return self.result
|
||||||
if self.holder:
|
if self.holder:
|
||||||
d = self._getglobals()
|
|
||||||
if self.holder.args or 'condition' in self.holder.kwargs:
|
if self.holder.args or 'condition' in self.holder.kwargs:
|
||||||
self.result = False
|
self.result = False
|
||||||
# "holder" might be a MarkInfo or a MarkDecorator; only
|
# "holder" might be a MarkInfo or a MarkDecorator; only
|
||||||
|
@ -135,6 +134,7 @@ class MarkEvaluator:
|
||||||
for expr in args:
|
for expr in args:
|
||||||
self.expr = expr
|
self.expr = expr
|
||||||
if isinstance(expr, py.builtin._basestring):
|
if isinstance(expr, py.builtin._basestring):
|
||||||
|
d = self._getglobals()
|
||||||
result = cached_eval(self.item.config, expr, d)
|
result = cached_eval(self.item.config, expr, d)
|
||||||
else:
|
else:
|
||||||
if "reason" not in kwargs:
|
if "reason" not in kwargs:
|
||||||
|
|
Loading…
Reference in New Issue