Skip to content

Commit

Permalink
Do not asssume Item.obj in 'skipping' plugin
Browse files Browse the repository at this point in the history
See pytest-dev#2231 for discussion.
  • Loading branch information
vidartf authored Feb 3, 2017
1 parent da5a3db commit bad2612
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _pytest/skipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def istrue(self):

def _getglobals(self):
d = {'os': os, 'sys': sys, 'config': self.item.config}
d.update(self.item.obj.__globals__)
if hasattr(self.item, 'obj'):
d.update(self.item.obj.__globals__)
return d

def _istrue(self):
Expand Down

0 comments on commit bad2612

Please sign in to comment.