
unittest-ext - issue #68
unittest2's loadTestFromName() can't load test cases derived from unittest.TestCase
I tried to use unittest2's defaultTestLoader.loadTestsFromNames() to load a specific test from a test case derived from the standard Python 2.6 unittest.TestCase. It would not be recongized.
The attached patch fixes the problem.
- ut2.patch 1.86KB
Comment #1
Posted on Nov 18, 2011 by Helpful Monkeysigh I think you're correct. Thanks for the report and the fix.
Comment #2
Posted on May 20, 2013 by Massive WombatWe're hitting this problem in Django as well, FWIW; we've applied this patch to our bundled unittest2, but it still breaks if the user has installed unittest2 from PyPI (as we privilege the version from PyPI over our bundled version).
Comment #3
Posted on May 20, 2013 by Massive WombatThe Django ticket tracking this is https://code.djangoproject.com/ticket/20437
Comment #4
Posted on Aug 9, 2013 by Helpful MonkeyI'm planning a new release with a couple of bugfixes including this one.
Comment #5
Posted on Nov 4, 2014 by Quick BirdSo, need to fix this upstream ideally to make backports easier.
Comment #6
Posted on Nov 4, 2014 by Helpful MonkeyI think this is a unittest2 specific issue. unittest2 needs to check for subclasses of unittest.TestCase, not just TestCase (which will mean unittest2.TestCase).
Status: Accepted
Labels:
Type-Defect
Priority-Medium