-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Description
Hi!
We're currently writing a plugin for py.test that collects custom tests (i.e. our own class that inherits from pytest.Item). I want to add an xfail marker to these, so I try to do this dynamically via item.add_marker(). If I do this, and run the tests, it will fail on this line:
d.update(self.item.obj.__globals__)Here, the skipping plugin assumes that the item has an obj attribute, which again has a __globals__ attribute. I can side-step this issue by simply adding a dummy variable here, with an empty __globals__ dict, but I want to ensure that:
- I am not doing something stupid by adding the dummy
- I am not doing something wrong elsewhere since I am missing the
objattribute - I report this so that I minimize the risk of our plugin failing for similar reasons in the future
Am I doing it right? 😄
Metadata
Metadata
Assignees
Labels
No labels