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

pytest --pdb execute test cases which otherwise are skipped #2137

gst opened this issue Dec 14, 2016 · 2 comments

pytest --pdb execute test cases which otherwise are skipped #2137

gst opened this issue Dec 14, 2016 · 2 comments


Copy link

@gst gst commented Dec 14, 2016


using pytest 3.0.5 (and xdist (1.15) + cov plugins (2.3.1)), under linux :

reproduce steps :

18:58 $ cat

import platform

import unittest2 as unittest

@unittest.skipIf(platform.system() != 'Windows', 'This test need to be run on Windows!')
class MyTestCase(unittest.TestCase):

    def test_one(self):

this is ok :
pytest -xv

this is not ok : the test is executed and here obviously fail
pytest --pdb -xv

Copy link

@nicoddemus nicoddemus commented Dec 14, 2016

Thanks for the report!

This is a side effect of #1890, because now the skip machinery for unittest.TestCase tests is not reached when --pdb is given in the command line (

    def runtest(self):
        if self.config.pluginmanager.get_plugin("pdbinvoke") is None:
            # disables tearDown and cleanups for post mortem debugging (see #1890)

Have to think about a proper fix for this, we probably need to handle other types of failures as well (such as unexpectedSuccess). Perhaps @mbyt can chime in?

Copy link

@mbyt mbyt commented Jan 31, 2017

Thanks for reporting - and yes, that's definitely a regression.

@nicoddemus, sorry for being late. I looked into this and proposed a possible solution in #2225.

@nicoddemus nicoddemus closed this in d1c7250 Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants