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

Decorating test classes/methods makes them not found by test harness. #16

Closed
schinckel opened this issue Apr 10, 2013 · 1 comment · Fixed by #17
Closed

Decorating test classes/methods makes them not found by test harness. #16

schinckel opened this issue Apr 10, 2013 · 1 comment · Fixed by #17

Comments

@schinckel
Copy link
Contributor

I'm using django.

I have some tests that I'm trying to freeze time for, but when I decorate the test method, it is no longer found by django's test framework. Same deal when I decorate the class.

$ ./manage.py test app.TestClassName
Traceback (most recent call last):
...
ValueError: Test label 'app.TestClassName' does not refer to a test.

Without the decoration, the test is found (but fails, obviously).

I can freeze in .setUp() and thaw in .tearDown(), but the decorator syntax is nicer.

@schinckel
Copy link
Contributor Author

Okay, it looks like decorating a test method works, just not a TestCase.

This is because the decorator returns a function, and the django test runner looks for subclasses of unittest.TestCase.

I am working on a patch.

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 a pull request may close this issue.

1 participant