bobber6467 / python-nose

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

class fixture are not properly handled in multiprocess #462

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
create a test.py file with the following content:
class TestFunctionalTest(object):
    counter = 0
    @classmethod
    def setup_class(cls):
        cls.counter += 1
    @classmethod
    def teardown_class(cls):
        cls.counter -= 1
    def _runSingleFT(self,file):
        assert self.counter==1
    def test1(self):
        self._runSingleFT(None)
    def test2(self):
        self._runSingleFT(None)

with nosetests 1.1.2:
nosetests --processes=2 test.py

both of test1 and test2 fail because self.counter is 0

without multiprocess plugin, all tests pass. nosetests 1.0.0 multiprocess works 
properly with this test case, so this is a regression

Original issue reported on code.google.com by liucou...@gmail.com on 24 Oct 2011 at 7:43

GoogleCodeExporter commented 8 years ago
it seems teardown_class is called before any tests are executed

Original comment by liucou...@gmail.com on 24 Oct 2011 at 7:45

GoogleCodeExporter commented 8 years ago
my fork below has fix for this issue 
https://liucougar@code.google.com/r/liucougar-nose/

Original comment by liucou...@gmail.com on 31 Oct 2011 at 11:03

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 536fe29dd1e7.

Original comment by liucou...@gmail.com on 2 Nov 2011 at 5:26