-
Notifications
You must be signed in to change notification settings - Fork 344
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
TestCase inheritance breaks with setUpTestData (Django 1.8) #265
Comments
Yes, it looks like the new instancemethods should use I think the way forward would be to create a PR with your failing test (great!), and then try to fix it from there. |
Thanks for the test case, that should make a fix for this much easier! I'd like to have this fixed before the next release, I will try to take a stab at it the next couple of days if no one else wants to give it a try. |
@bforchhammer I have a fix for this in PR #277 - could you give it a try and make sure it fixes your problem?
|
…ritance pytest-django monkeypatches Django's setUpClass / tearDownClass to call them at the correct time during fixture setup/teardown. The previous implementation caused problems when used with multiple inheritance. This commit fixes issue #265.
The fix is now merged in master, I'm closing this issue now. Please re-open if there are any problems with the fix! |
…ritance pytest-django monkeypatches Django's setUpClass / tearDownClass to call them at the correct time during fixture setup/teardown. The previous implementation caused problems when used with multiple inheritance. This commit fixes issue pytest-dev#265.
…ritance pytest-django monkeypatches Django's setUpClass / tearDownClass to call them at the correct time during fixture setup/teardown. The previous implementation caused problems when used with multiple inheritance. This commit fixes issue pytest-dev#265.
Hi,
We have a large test base with test cases which inherit from each other. I am in the process of converting them to Django 1.8 and tried to use the new
setUpTestData
class method for setting up test data.This fails in a very strange way for tests using inheritance:
setUpTestData
is only invoked for the base class and not for the derived class. I think this may be because of this commit, which changes and overridessetUpClass
andtearDownClass
in a way which I honestly don't quite understand...I have created a failing test which shows the problem; the lines which cause errors are annotated with
TODO
comments.Any ideas on how to fix or circumvent this problem are greatly appreciated! :-)
The text was updated successfully, but these errors were encountered: