(self, pytester: Pytester)
| 559 | result.stdout.fnmatch_lines(["*2 passed*"]) |
| 560 | |
| 561 | def test_autouse_fixture_plugin(self, pytester: Pytester) -> None: |
| 562 | # A fixture from a plugin has no baseid set, which screwed up |
| 563 | # the autouse fixture handling. |
| 564 | pytester.makepyfile( |
| 565 | testplugin=""" |
| 566 | import pytest |
| 567 | |
| 568 | @pytest.fixture(autouse=True) |
| 569 | def foo(request): |
| 570 | request.function.foo = 7 |
| 571 | """ |
| 572 | ) |
| 573 | pytester.syspathinsert() |
| 574 | pytester.makepyfile( |
| 575 | """ |
| 576 | pytest_plugins = 'testplugin' |
| 577 | |
| 578 | def test_foo(request): |
| 579 | assert request.function.foo == 7 |
| 580 | """ |
| 581 | ) |
| 582 | result = pytester.runpytest() |
| 583 | assert result.ret == 0 |
| 584 | |
| 585 | def test_funcarg_lookup_error(self, pytester: Pytester) -> None: |
| 586 | pytester.makeconftest( |
nothing calls this directly
no test coverage detected