(pytester: Pytester, monkeypatch: MonkeyPatch)
| 463 | |
| 464 | |
| 465 | def test_conftest_import_order(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: |
| 466 | ct1 = pytester.makeconftest("") |
| 467 | sub = pytester.mkdir("sub") |
| 468 | ct2 = sub / "conftest.py" |
| 469 | ct2.write_text("", encoding="utf-8") |
| 470 | |
| 471 | def impct(p, importmode, root, consider_namespace_packages): |
| 472 | return p |
| 473 | |
| 474 | conftest = PytestPluginManager() |
| 475 | conftest._confcutdir = pytester.path |
| 476 | monkeypatch.setattr(conftest, "_importconftest", impct) |
| 477 | conftest._loadconftestmodules( |
| 478 | sub, |
| 479 | importmode="prepend", |
| 480 | rootpath=pytester.path, |
| 481 | consider_namespace_packages=False, |
| 482 | ) |
| 483 | mods = cast(list[Path], conftest._getconftestmodules(sub)) |
| 484 | expected = [ct1, ct2] |
| 485 | assert mods == expected |
| 486 | |
| 487 | |
| 488 | def test_fixture_dependency(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected