Example #1
0
class TestExecuteTestProcess(TestCase):
    def setUp(self):
        spec, wrapper = _create_testing_spec()

        self.parent_pipe, self.child_pipe = mp.Pipe(duplex=False)
        self.work_queue = mp.Queue()
        self.work_queue.put(wrapper)
        self.work_queue.put("STOP")

        self.case_functions = {wrapper.id: wrapper.case_func}
        self.case_parents = {wrapper.parent.id: wrapper.parent}

        self.test_process = ExecuteTestProcess(
            self.work_queue,
            self.case_functions,
            self.case_parents,
            self.child_pipe,
            track_coverage=True,
            coverage_omit=[],
        )

    def test_create_instance_without_coverage(self):
        inst = ExecuteTestProcess(
            work_queue=None, all_cases=None, all_parents=None, pipe=None, track_coverage=True, coverage_omit=[]
        )
        self.assertIsNotNone(inst.coverage)

    def test_execute_a_process(self):
        self.test_process.run()

        result = self.parent_pipe.recv()
        self.assertIsNotNone(result)
        self.assertIsNotNone(self.test_process.coverage)
Example #2
0
class TestExecuteTestProcess(TestCase):
    def setUp(self):
        spec, wrapper = _create_testing_spec()

        self.parent_pipe, self.child_pipe = mp.Pipe(duplex=False)
        self.work_queue = mp.Queue()
        self.work_queue.put(wrapper)
        self.work_queue.put('STOP')

        self.case_functions = {wrapper.id: wrapper.case_func}
        self.case_parents = {wrapper.parent.id: wrapper.parent}

        self.test_process = ExecuteTestProcess(self.work_queue,
                                               self.case_functions,
                                               self.case_parents,
                                               self.child_pipe,
                                               track_coverage=True,
                                               coverage_omit=[])

    def test_create_instance_without_coverage(self):
        inst = ExecuteTestProcess(work_queue=None,
                                  all_cases=None,
                                  all_parents=None,
                                  pipe=None,
                                  track_coverage=True,
                                  coverage_omit=[])
        self.assertIsNotNone(inst.coverage)

    def test_execute_a_process(self):
        self.test_process.run()

        result = self.parent_pipe.recv()
        self.assertIsNotNone(result)
        self.assertIsNotNone(self.test_process.coverage)
Example #3
0
 def test_create_instance_without_coverage(self):
     inst = ExecuteTestProcess(work_queue=None,
                               all_cases=None,
                               all_parents=None,
                               pipe=None,
                               track_coverage=True,
                               coverage_omit=[])
     self.assertIsNotNone(inst.coverage)
Example #4
0
    def setUp(self):
        spec, wrapper = _create_testing_spec()

        self.parent_pipe, self.child_pipe = mp.Pipe(duplex=False)
        self.work_queue = mp.Queue()
        self.work_queue.put(wrapper)
        self.work_queue.put('STOP')

        self.case_functions = {wrapper.id: wrapper.case_func}
        self.case_parents = {wrapper.parent.id: wrapper.parent}

        self.test_process = ExecuteTestProcess(self.work_queue,
                                               self.case_functions,
                                               self.case_parents,
                                               self.child_pipe,
                                               track_coverage=True,
                                               coverage_omit=[])
Example #5
0
    def setUp(self):
        spec, wrapper = _create_testing_spec()

        self.parent_pipe, self.child_pipe = mp.Pipe(duplex=False)
        self.work_queue = mp.Queue()
        self.work_queue.put(wrapper)
        self.work_queue.put("STOP")

        self.case_functions = {wrapper.id: wrapper.case_func}
        self.case_parents = {wrapper.parent.id: wrapper.parent}

        self.test_process = ExecuteTestProcess(
            self.work_queue,
            self.case_functions,
            self.case_parents,
            self.child_pipe,
            track_coverage=True,
            coverage_omit=[],
        )