(pytester: Pytester)
| 1320 | |
| 1321 | |
| 1322 | def test_customized_python_discovery(pytester: Pytester) -> None: |
| 1323 | pytester.makeini( |
| 1324 | """ |
| 1325 | [pytest] |
| 1326 | python_files=check_*.py |
| 1327 | python_classes=Check |
| 1328 | python_functions=check |
| 1329 | """ |
| 1330 | ) |
| 1331 | p = pytester.makepyfile( |
| 1332 | """ |
| 1333 | def check_simple(): |
| 1334 | pass |
| 1335 | class CheckMyApp(object): |
| 1336 | def check_meth(self): |
| 1337 | pass |
| 1338 | """ |
| 1339 | ) |
| 1340 | p2 = p.with_name(p.name.replace("test", "check")) |
| 1341 | p.rename(p2) |
| 1342 | result = pytester.runpytest("--collect-only", "-s") |
| 1343 | result.stdout.fnmatch_lines( |
| 1344 | ["*check_customized*", "*check_simple*", "*CheckMyApp*", "*check_meth*"] |
| 1345 | ) |
| 1346 | |
| 1347 | result = pytester.runpytest() |
| 1348 | assert result.ret == 0 |
| 1349 | result.stdout.fnmatch_lines(["*2 passed*"]) |
| 1350 | |
| 1351 | |
| 1352 | def test_customized_python_discovery_functions(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…