Lines Matching refs:testinstance
13 from twisterlib.testinstance import TestInstance
18 def testinstance() -> TestInstance: function
25 testinstance = TestInstance(testsuite, platform, 'outdir')
26 testinstance.handler = mock.Mock()
27 testinstance.handler.options = mock.Mock()
28 testinstance.handler.options.verbose = 1
29 testinstance.handler.options.fixture = ['fixture1:option1', 'fixture2']
30 testinstance.handler.options.pytest_args = None
31 testinstance.handler.options.extra_test_args = []
32 testinstance.handler.type_str = 'native'
33 return testinstance
37 def test_pytest_command(testinstance: TestInstance, device_type):
39 pytest_harness.configure(testinstance)
41 testinstance.handler.type_str = device_type
57 def test_pytest_command_dut_scope(testinstance: TestInstance):
60 testinstance.testsuite.harness_config['pytest_dut_scope'] = dut_scope
61 pytest_harness.configure(testinstance)
66 def test_pytest_command_extra_args(testinstance: TestInstance):
69 testinstance.testsuite.harness_config['pytest_args'] = pytest_args
70 pytest_harness.configure(testinstance)
76 def test_pytest_command_extra_test_args(testinstance: TestInstance):
79 testinstance.handler.options.extra_test_args = extra_test_args
80 pytest_harness.configure(testinstance)
85 def test_pytest_command_extra_args_in_options(testinstance: TestInstance):
89 testinstance.testsuite.harness_config['pytest_args'] = [pytest_args_from_yaml]
90 testinstance.handler.options.pytest_args = pytest_args_from_cmd
91 pytest_harness.configure(testinstance)
149 def test_pytest_handle_source_list(testinstance: TestInstance, monkeypatch, pytest_root, expected):
152 testinstance.testsuite.harness_config['pytest_root'] = pytest_root
154 pytest_harness.configure(testinstance)
160 def test_if_report_is_parsed(pytester, testinstance: TestInstance):
178 pytest_harness.configure(testinstance)
184 assert testinstance.status == "passed"
185 assert len(testinstance.testcases) == 2
186 for tc in testinstance.testcases:
190 def test_if_report_with_error(pytester, testinstance: TestInstance):
208 pytest_harness.configure(testinstance)
214 assert testinstance.status == "failed"
215 assert len(testinstance.testcases) == 2
216 for tc in testinstance.testcases:
220 assert testinstance.reason
221 assert '2/2' in testinstance.reason
224 def test_if_report_with_skip(pytester, testinstance: TestInstance):
244 pytest_harness.configure(testinstance)
250 assert testinstance.status == "skipped"
251 assert len(testinstance.testcases) == 2
252 for tc in testinstance.testcases:
256 def test_if_report_with_filter(pytester, testinstance: TestInstance):
276 pytest_harness.configure(testinstance)
280 assert testinstance.status == "passed"
281 assert len(testinstance.testcases) == 1
284 def test_if_report_with_no_collected(pytester, testinstance: TestInstance):
302 pytest_harness.configure(testinstance)
306 assert testinstance.status == "skipped"