(pytester: Pytester, monkeypatch: MonkeyPatch)
| 377 | |
| 378 | |
| 379 | def test_conftest_import_order(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: |
| 380 | ct1 = pytester.makeconftest("") |
| 381 | sub = pytester.mkdir("sub") |
| 382 | ct2 = sub / "conftest.py" |
| 383 | ct2.write_text("") |
| 384 | |
| 385 | def impct(p, importmode, root): |
| 386 | return p |
| 387 | |
| 388 | conftest = PytestPluginManager() |
| 389 | conftest._confcutdir = pytester.path |
| 390 | monkeypatch.setattr(conftest, "_importconftest", impct) |
| 391 | mods = cast( |
| 392 | List[Path], |
| 393 | conftest._getconftestmodules(sub, importmode="prepend", rootpath=pytester.path), |
| 394 | ) |
| 395 | expected = [ct1, ct2] |
| 396 | assert mods == expected |
| 397 | |
| 398 | |
| 399 | def test_fixture_dependency(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected