File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -437,13 +437,17 @@ def fix_cobertura_filename(line: str) -> str:
437437##
438438
439439
440+ # This function name is special to pytest. See
441+ # http://doc.pytest.org/en/latest/writing_plugins.html#initialization-command-line-and-configuration-hooks
440442def pytest_addoption (parser : Any ) -> None :
441443 group = parser .getgroup ('mypy' )
442444 group .addoption ('--update-data' , action = 'store_true' , default = False ,
443445 help = 'Update test data to reflect actual output'
444446 ' (supported only for certain tests)' )
445447
446448
449+ # This function name is special to pytest. See
450+ # http://doc.pytest.org/en/latest/writing_plugins.html#collection-hooks
447451def pytest_pycollect_makeitem (collector : Any , name : str , obj : Any ) -> Any :
448452 if not isinstance (obj , type ) or not issubclass (obj , DataSuite ):
449453 return None
Original file line number Diff line number Diff line change @@ -6,7 +6,14 @@ testpaths = mypy/test
66
77python_files = test*.py
88
9- # empty patterns for default python collector, to stick to our plugin's collector
9+ # Where do the test cases come from? We provide our own collection
10+ # logic by implementing `pytest_pycollect_makeitem` in mypy.test.data;
11+ # the test files import that module, and pytest sees the magic name
12+ # and invokes it at the relevant moment. See
13+ # http://doc.pytest.org/en/latest/writing_plugins.html#collection-hooks
14+
15+ # Because we provide our own collection logic, disable the default
16+ # python collector by giving it empty patterns to search for.
1017python_classes =
1118python_functions =
1219
You can’t perform that action at this time.
0 commit comments