|
13 | 13 |
|
14 | 14 | from mypy.myunit import Suite, AssertionFailure, assert_equal
|
15 | 15 | from mypy.test.helpers import assert_string_arrays_equal
|
16 |
| -from mypy.test.data import parse_test_cases, DataDrivenTestCase |
| 16 | +from mypy.test.data import DataSuite, parse_test_cases, DataDrivenTestCase |
17 | 17 | from mypy.test import config
|
18 | 18 | from mypy.parse import parse
|
19 | 19 | from mypy.errors import CompileError
|
@@ -95,15 +95,19 @@ def test_infer_sig_from_docstring(self) -> None:
|
95 | 95 | assert_equal(infer_sig_from_docstring('\nfunc x', 'func'), None)
|
96 | 96 |
|
97 | 97 |
|
98 |
| -class StubgenPythonSuite(Suite): |
| 98 | +class StubgenPythonSuite(DataSuite): |
99 | 99 | test_data_files = ['stubgen.test']
|
100 | 100 |
|
101 |
| - def cases(self) -> List[DataDrivenTestCase]: |
| 101 | + @classmethod |
| 102 | + def cases(cls) -> List[DataDrivenTestCase]: |
102 | 103 | c = [] # type: List[DataDrivenTestCase]
|
103 |
| - for path in self.test_data_files: |
| 104 | + for path in cls.test_data_files: |
104 | 105 | c += parse_test_cases(os.path.join(config.test_data_prefix, path), test_stubgen)
|
105 | 106 | return c
|
106 | 107 |
|
| 108 | + def run_case(self, testcase: DataDrivenTestCase) -> None: |
| 109 | + test_stubgen(testcase) |
| 110 | + |
107 | 111 |
|
108 | 112 | def parse_flags(program_text: str) -> Options:
|
109 | 113 | flags = re.search('# flags: (.*)$', program_text, flags=re.MULTILINE)
|
|
0 commit comments