Skip to content

Commit

Permalink
Merge pull request pytest-dev#2142 from barneygale/xfail_without_cond…
Browse files Browse the repository at this point in the history
…ition_getglobals

'xfail' markers without a condition no longer rely on the underlying `Item` objects deriving from `PyobjMixin`
  • Loading branch information
nicoddemus authored Feb 3, 2017
2 parents da5a3db + df409a0 commit a4d2a57
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Antony Lee
Armin Rigo
Aron Curzon
Aviv Palivoda
Barney Gale
Ben Webb
Benjamin Peterson
Bernard Pratz
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

*

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion _pytest/skipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def _istrue(self):
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
Expand All @@ -135,6 +134,7 @@ def _istrue(self):
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:
Expand Down

0 comments on commit a4d2a57

Please sign in to comment.