Skip to content

Commit a4d2a57

Browse files
authored
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`
2 parents da5a3db + df409a0 commit a4d2a57

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Antony Lee
1616
Armin Rigo
1717
Aron Curzon
1818
Aviv Palivoda
19+
Barney Gale
1920
Ben Webb
2021
Benjamin Peterson
2122
Bernard Pratz

CHANGELOG.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
*
1010

11-
*
11+
* Conditionless ``xfail`` markers no longer rely on the underlying test item
12+
being an instance of ``PyobjMixin``, and can therefore apply to tests not
13+
collected by the built-in python test collector. Thanks `@barneygale`_ for the
14+
PR.
1215

1316
*
1417

@@ -49,6 +52,7 @@
4952
terminal output it relies on is missing. Thanks to `@eli-b`_ for the PR.
5053

5154

55+
.. _@barneygale: https://github.com/barneygale
5256
.. _@lesteve: https://github.com/lesteve
5357
.. _@malinoff: https://github.com/malinoff
5458
.. _@pelme: https://github.com/pelme

_pytest/skipping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def _istrue(self):
119119
if hasattr(self, 'result'):
120120
return self.result
121121
if self.holder:
122-
d = self._getglobals()
123122
if self.holder.args or 'condition' in self.holder.kwargs:
124123
self.result = False
125124
# "holder" might be a MarkInfo or a MarkDecorator; only
@@ -135,6 +134,7 @@ def _istrue(self):
135134
for expr in args:
136135
self.expr = expr
137136
if isinstance(expr, py.builtin._basestring):
137+
d = self._getglobals()
138138
result = cached_eval(self.item.config, expr, d)
139139
else:
140140
if "reason" not in kwargs:

0 commit comments

Comments
 (0)