summaryrefslogtreecommitdiff
path: root/functional_tests/test_multiprocessing/test_concurrent_shared.py
blob: cce3a50958de09a364fe408df2152b0966ca4dbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os

from test_multiprocessing import MPTestBase

class TestConcurrentShared(MPTestBase):
    processes = 2
    suitepath = os.path.join(os.path.dirname(__file__), 'support',
                             'concurrent_shared')

    def runTest(self):
        assert 'Ran 2 tests in 1.' in self.output, "make sure two tests use 1.x seconds (no more than 2 seconsd)"
        assert str(self.output).strip().endswith('OK')


class TestConcurrentSharedWithAutomaticProcessesCount(MPTestBase):
    """Make sure negative numbers are handled gracefully."""
    processes = -1
    suitepath = os.path.join(os.path.dirname(__file__), 'support',
                             'concurrent_shared')

    def runTest(self):
        assert 'Ran 2 tests in 1.' in self.output, "make sure two tests use 1.x seconds (no more than 2 seconsd)"
        assert str(self.output).strip().endswith('OK')