@@ -79,3 +79,47 @@ extra-standard-library = ["typing_extensions"]
79
79
80
80
[tool .check-manifest ]
81
81
ignore = [" **/.readthedocs.yaml" ]
82
+
83
+ [tool .pytest .ini_options ]
84
+ minversion = " 6.0.0"
85
+ testpaths = [" mypy/test" , " mypyc/test" ]
86
+ python_files = ' test*.py'
87
+
88
+ # Where do the test cases come from? We provide our own collection
89
+ # logic by implementing `pytest_pycollect_makeitem` in mypy.test.data;
90
+ # the test files import that module, and pytest sees the magic name
91
+ # and invokes it at the relevant moment. See
92
+ # https://doc.pytest.org/en/latest/how-to/writing_plugins.html#collection-hooks
93
+
94
+ # Both our plugin and unittest provide their own collection logic,
95
+ # So we can disable the default python collector by giving it empty
96
+ # patterns to search for.
97
+ # Note that unittest requires that no "Test*" classes exist.
98
+ python_classes = []
99
+ python_functions = []
100
+
101
+ # always run in parallel (requires pytest-xdist, see test-requirements.txt)
102
+ # and enable strict mode: require all markers
103
+ # to be defined and raise on invalid config values
104
+ addopts = " -nauto --strict-markers --strict-config"
105
+
106
+ # treat xpasses as test failures so they get converted to regular tests as soon as possible
107
+ xfail_strict = true
108
+
109
+ [tool .coverage .run ]
110
+ branch = true
111
+ source = " mypy"
112
+ parallel = true
113
+
114
+ [tool .coverage .report ]
115
+ show_missing = true
116
+ skip_covered = true
117
+ omit = ' mypy/test/*'
118
+ exclude_lines = [
119
+ ' \#\s*pragma: no cover' ,
120
+ ' ^\s*raise AssertionError\b' ,
121
+ ' ^\s*raise NotImplementedError\b' ,
122
+ ' ^\s*return NotImplemented\b' ,
123
+ ' ^\s*raise$' ,
124
+ ''' ^if __name__ == ['"]__main__['"]:$''' ,
125
+ ]
0 commit comments