Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not asssume Item.obj in 'skipping' plugin #2232

Merged
merged 3 commits into from
Feb 3, 2017

Conversation

vidartf
Copy link
Contributor

@vidartf vidartf commented Feb 3, 2017

See #2231 for discussion.

Not entirely sure how to best wire up a regression test for this, but the following code should do the trick once collected:

class CustomItem(pytest.Item):
    def setup(self):
        marker = pytest.mark.xfail(True)
        self.add_marker(marker)

    def runtest(self):
        assert False

@vidartf vidartf changed the title Patch 1 Do not asssume Item.obj in 'skipping' plugin Feb 3, 2017
@nicoddemus
Copy link
Member

Hey @vidartf thanks for following up with this! 👍

Could you use the code you suggest along with the other files necessary (conftest.py file with custom collection hook, etc) which proves the patch work? If so, we can add an integration test in test_skipping.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0008%) to 92.833% when pulling 1a88a91 on vidartf:patch-1 into da5a3db on pytest-dev:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0008%) to 92.833% when pulling 832c89d on vidartf:patch-1 into da5a3db on pytest-dev:master.

@vidartf
Copy link
Contributor Author

vidartf commented Feb 3, 2017

@nicoddemus I added a test, and after an initial mistake, it seems now to pass. Is this sufficient?

Note: The mistaken test strangely passed on some versions of python. Is this a problem with CI? You will have to check CI logs to see it, as I rebased to keep git history clean.

@nicoddemus
Copy link
Member

Very nice, thank you!

@nicoddemus nicoddemus merged commit ccf9877 into pytest-dev:master Feb 3, 2017
@vidartf vidartf deleted the patch-1 branch February 4, 2017 21:33
vidartf added a commit to vidartf/nbval that referenced this pull request Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants