-
Notifications
You must be signed in to change notification settings - Fork 131
When I use generator tests, setUp() doesn't get run before the test #80
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
Comments
I can't reproduce this. With this test module:
I get this output:
|
Ah, looks like setup is being run but on the wrong instance:
Gives setup! instance: 3073307340 Note the different ID numbers between the setUp and test being run. |
That's correct behavior, actually. The generator tests are generated as On Thu, May 9, 2013 at 12:15 PM, Shaun Crampton [email protected]:
|
But shouldn't the setUp also be run on the same generated test case? I was expecting a generated test to behave just as if I'd added multiple extra test methods to my class. Right now, the code above hits an exception when it tries to access self.foo because self points to a different instance to the setUp. |
Ah, I see what you're saying now. Sorry I misunderstood. That does seem On Thu, May 9, 2013 at 12:49 PM, Shaun Crampton [email protected]:
|
The parameterize plugin looks like it behaves correctly, so the fix is On Thu, May 9, 2013 at 12:55 PM, jason pellerin [email protected] wrote:
|
Ah, the parametrize plugin looks like it'll be nicer for my use case anyway. I'll switch to that. |
Parameterize is better for almost all cases, I think. But I should still On Thu, May 9, 2013 at 2:48 PM, Shaun Crampton [email protected]:
|
I'm also having this issue, but cannot use parameters because they are randomized values. Is there a quick fix? |
Maybe:
... as far as fixing in nose2 itself, no, it won't be quick. The generators On Wed, Jun 5, 2013 at 2:03 PM, trilogysci [email protected] wrote:
|
This bug make impossibile to run tests on a data loaded for an external file or db |
I made the fixture working by adding the variables in the class directly instead of creating them in setUpClass method eg:
|
I wrote a test like this:
The tests are detected and run but self.setUp() doesn't get run before either test.
The text was updated successfully, but these errors were encountered: