(self, pytester: Pytester, monkeypatch)
| 373 | result.stdout.fnmatch_lines(["*assert 1 == 2*"]) |
| 374 | |
| 375 | def test_honors_pep_235(self, pytester: Pytester, monkeypatch) -> None: |
| 376 | # note: couldn't make it fail on macos with a single `sys.path` entry |
| 377 | # note: these modules are named `test_*` to trigger rewriting |
| 378 | pytester.makepyfile(test_y="x = 1") |
| 379 | xdir = pytester.mkdir("x") |
| 380 | pytester.mkpydir(str(xdir.joinpath("test_Y"))) |
| 381 | xdir.joinpath("test_Y").joinpath("__init__.py").write_text( |
| 382 | "x = 2", encoding="utf-8" |
| 383 | ) |
| 384 | pytester.makepyfile( |
| 385 | "import test_y\n" |
| 386 | "import test_Y\n" |
| 387 | "def test():\n" |
| 388 | " assert test_y.x == 1\n" |
| 389 | " assert test_Y.x == 2\n" |
| 390 | ) |
| 391 | monkeypatch.syspath_prepend(str(xdir)) |
| 392 | pytester.runpytest().assert_outcomes(passed=1) |
| 393 | |
| 394 | def test_name(self, request) -> None: |
| 395 | def f1() -> None: |
nothing calls this directly
no test coverage detected