(pytester: Pytester)
| 1206 | |
| 1207 | |
| 1208 | def test_customized_python_discovery(pytester: Pytester) -> None: |
| 1209 | pytester.makeini( |
| 1210 | """ |
| 1211 | [pytest] |
| 1212 | python_files=check_*.py |
| 1213 | python_classes=Check |
| 1214 | python_functions=check |
| 1215 | """ |
| 1216 | ) |
| 1217 | p = pytester.makepyfile( |
| 1218 | """ |
| 1219 | def check_simple(): |
| 1220 | pass |
| 1221 | class CheckMyApp(object): |
| 1222 | def check_meth(self): |
| 1223 | pass |
| 1224 | """ |
| 1225 | ) |
| 1226 | p2 = p.with_name(p.name.replace("test", "check")) |
| 1227 | p.rename(p2) |
| 1228 | result = pytester.runpytest("--collect-only", "-s") |
| 1229 | result.stdout.fnmatch_lines( |
| 1230 | ["*check_customized*", "*check_simple*", "*CheckMyApp*", "*check_meth*"] |
| 1231 | ) |
| 1232 | |
| 1233 | result = pytester.runpytest() |
| 1234 | assert result.ret == 0 |
| 1235 | result.stdout.fnmatch_lines(["*2 passed*"]) |
| 1236 | |
| 1237 | |
| 1238 | def test_customized_python_discovery_functions(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected