| 647 | |
| 648 | class TestRequestBasic: |
| 649 | def test_request_attributes(self, pytester: Pytester) -> None: |
| 650 | item = pytester.getitem( |
| 651 | """ |
| 652 | import pytest |
| 653 | |
| 654 | @pytest.fixture |
| 655 | def something(request): pass |
| 656 | def test_func(something): pass |
| 657 | """ |
| 658 | ) |
| 659 | assert isinstance(item, Function) |
| 660 | req = fixtures.FixtureRequest(item, _ispytest=True) |
| 661 | assert req.function == item.obj |
| 662 | assert req.keywords == item.keywords |
| 663 | assert hasattr(req.module, "test_func") |
| 664 | assert req.cls is None |
| 665 | assert req.function.__name__ == "test_func" |
| 666 | assert req.config == item.config |
| 667 | assert repr(req).find(req.function.__name__) != -1 |
| 668 | |
| 669 | def test_request_attributes_method(self, pytester: Pytester) -> None: |
| 670 | (item,) = pytester.getitems( |