Perform a runtime checking transformation test case.
(self, testcase: DataDrivenTestCase)
| 24 | base_path = test_temp_dir |
| 25 | |
| 26 | def run_case(self, testcase: DataDrivenTestCase) -> None: |
| 27 | """Perform a runtime checking transformation test case.""" |
| 28 | options = infer_ir_build_options_from_test_name(testcase.name) |
| 29 | if options is None: |
| 30 | # Skipped test case |
| 31 | return |
| 32 | with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase): |
| 33 | try: |
| 34 | ir = build_ir_for_single_file2(testcase.input, options)[0] |
| 35 | except CompileError as e: |
| 36 | actual = e.messages |
| 37 | else: |
| 38 | actual = [] |
| 39 | for cl in ir.classes: |
| 40 | if cl.name.startswith("_"): |
| 41 | continue |
| 42 | actual.append( |
| 43 | "{}: [{}]".format(cl.name, ", ".join(sorted(cl._always_initialized_attrs))) |
| 44 | ) |
| 45 | |
| 46 | assert_test_output(testcase, actual, "Invalid test output", testcase.output) |
nothing calls this directly
no test coverage detected