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

unittest2's loadTestFromName() can't load test cases derived from unittest.TestCase #68

Open
GoogleCodeExporter opened this issue Mar 13, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link

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.

Original issue reported on code.google.com by [email protected] on 18 Nov 2011 at 11:50

Attachments:

@GoogleCodeExporter
Copy link
Author

*sigh* I think you're correct. Thanks for the report and the fix.

Original comment by fuzzyman on 18 Nov 2011 at 12:00

@GoogleCodeExporter
Copy link
Author

We'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).

Original comment by carl.j.meyer on 20 May 2013 at 5:38

@GoogleCodeExporter
Copy link
Author

The Django ticket tracking this is https://code.djangoproject.com/ticket/20437

Original comment by carl.j.meyer on 20 May 2013 at 5:42

@GoogleCodeExporter
Copy link
Author

I'm planning a new release with a couple of bugfixes including this one.

Original comment by fuzzyman on 9 Aug 2013 at 9:54

@GoogleCodeExporter
Copy link
Author

So, need to fix this upstream ideally to make backports easier.

Original comment by [email protected] on 4 Nov 2014 at 3:16

  • Changed title: unittest2's loadTestFromName() can't load test cases derived from unittest.TestCase
  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

I think this is a unittest2 specific issue. unittest2 needs to check for 
subclasses of *unittest.TestCase*, not just TestCase (which will mean 
unittest2.TestCase).

Original comment by fuzzyman on 4 Nov 2014 at 3:32

@Codonaut
Copy link

So it looks like this was never merged in, but I could really use it. Any updates at all on this issue?

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

No branches or pull requests

2 participants