(self, pytester: Pytester)
| 1108 | |
| 1109 | class TestRequestMarking: |
| 1110 | def test_applymarker(self, pytester: Pytester) -> None: |
| 1111 | item1, item2 = pytester.getitems( |
| 1112 | """ |
| 1113 | import pytest |
| 1114 | |
| 1115 | @pytest.fixture |
| 1116 | def something(request): |
| 1117 | pass |
| 1118 | class TestClass(object): |
| 1119 | def test_func1(self, something): |
| 1120 | pass |
| 1121 | def test_func2(self, something): |
| 1122 | pass |
| 1123 | """ |
| 1124 | ) |
| 1125 | req1 = fixtures.FixtureRequest(item1, _ispytest=True) |
| 1126 | assert "xfail" not in item1.keywords |
| 1127 | req1.applymarker(pytest.mark.xfail) |
| 1128 | assert "xfail" in item1.keywords |
| 1129 | assert "skipif" not in item1.keywords |
| 1130 | req1.applymarker(pytest.mark.skipif) |
| 1131 | assert "skipif" in item1.keywords |
| 1132 | with pytest.raises(ValueError): |
| 1133 | req1.applymarker(42) # type: ignore[arg-type] |
| 1134 | |
| 1135 | def test_accesskeywords(self, pytester: Pytester) -> None: |
| 1136 | pytester.makepyfile( |
nothing calls this directly
no test coverage detected