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

from test_multiprocessing import MPTestBase

class TestMPTimeout(MPTestBase):
    args = ['--process-timeout=1']
    suitepath = os.path.join(os.path.dirname(__file__), 'support', 'timeout.py')

    def runTest(self):
        assert "TimedOutException: 'timeout.test_timeout'" in self.output
        assert "Ran 2 tests in" in self.output
        assert "FAILED (errors=1)" in self.output

class TestMPTimeoutPass(TestMPTimeout):
    args = ['--process-timeout=3']

    def runTest(self):
        assert "TimedOutException: 'timeout.test_timeout'" not in self.output
        assert "Ran 2 tests in" in self.output
        assert str(self.output).strip().endswith('OK')