(
expr: str, expected_passed: list[str], pytester: Pytester
)
| 302 | [("interface", ["test_interface"]), ("not interface", ["test_nointer"])], |
| 303 | ) |
| 304 | def test_mark_option_custom( |
| 305 | expr: str, expected_passed: list[str], pytester: Pytester |
| 306 | ) -> None: |
| 307 | pytester.makeconftest( |
| 308 | """ |
| 309 | import pytest |
| 310 | def pytest_collection_modifyitems(items): |
| 311 | for item in items: |
| 312 | if "interface" in item.nodeid: |
| 313 | item.add_marker(pytest.mark.interface) |
| 314 | """ |
| 315 | ) |
| 316 | pytester.makepyfile( |
| 317 | """ |
| 318 | def test_interface(): |
| 319 | pass |
| 320 | def test_nointer(): |
| 321 | pass |
| 322 | """ |
| 323 | ) |
| 324 | rec = pytester.inline_run("-m", expr) |
| 325 | passed, _skipped, _fail = rec.listoutcomes() |
| 326 | passed_str = [x.nodeid.split("::")[-1] for x in passed] |
| 327 | assert passed_str == expected_passed |
| 328 | |
| 329 | |
| 330 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected