pombreda / python-nose

Automatically exported from code.google.com/p/python-nose
0 stars 0 forks source link

teardown_class is called while it shouldn't if multiple tests is specified #408

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create an empty dir
2. download the attached test.py and save it under this dir
3. nosetests -v
4. the previous command will successfully run 4 tests
5. nosetests test:testa.test1 test:testa.test2 test:testb.test1 test:testb.test2
6. failure:
...F
======================================================================
FAIL: test.testb.test2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nose/case.py", line 187, in runTest
    self.test(*self.arg)
  File "/tp/nose-bug/test.py", line 11, in test2
    assert self.inited
AssertionError

----------------------------------------------------------------------
Ran 4 tests in 0.003s

FAILED (failures=1)

What is the expected output? What do you see instead?
it should all pass, not throwing that assertion error

What version of the product are you using? On what operating system?
1.0.0

Original issue reported on code.google.com by liucou...@gmail.com on 30 Mar 2011 at 12:34

Attachments:

GoogleCodeExporter commented 9 years ago
attached is a proposed patch, which fixes the bug

the patch also adds a functional test case for this bug

Original comment by liucou...@gmail.com on 30 Mar 2011 at 4:06

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks a lot for taking the time to write a patch with tests!  There were some 
formatting errors where tabs and spaces were mixed (might want to fix that in 
your editor).  I fixed it up and it will go out shortly in 1.0.1, see revission 
15973c128262

Can you send me your full name? I'd like to add it to the AUTHORS file.  Thanks 
again.

Original comment by kumar.mcmillan on 1 Apr 2011 at 5:57

GoogleCodeExporter commented 9 years ago
whoops, typo, here is a magic link: revision 15973c128262

Original comment by kumar.mcmillan on 1 Apr 2011 at 5:58

GoogleCodeExporter commented 9 years ago
my full name is: Heng Liu

good to know it will be in 1.0.1

Original comment by liucou...@gmail.com on 1 Apr 2011 at 6:02

GoogleCodeExporter commented 9 years ago
Thanks, added in revision 417149925802

Original comment by kumar.mcmillan on 1 Apr 2011 at 7:01