(
expr: str, expected_passed: List[str], pytester: Pytester
)
| 237 | [("interface", ["test_interface"]), ("not interface", ["test_nointer"])], |
| 238 | ) |
| 239 | def test_mark_option_custom( |
| 240 | expr: str, expected_passed: List[str], pytester: Pytester |
| 241 | ) -> None: |
| 242 | pytester.makeconftest( |
| 243 | """ |
| 244 | import pytest |
| 245 | def pytest_collection_modifyitems(items): |
| 246 | for item in items: |
| 247 | if "interface" in item.nodeid: |
| 248 | item.add_marker(pytest.mark.interface) |
| 249 | """ |
| 250 | ) |
| 251 | pytester.makepyfile( |
| 252 | """ |
| 253 | def test_interface(): |
| 254 | pass |
| 255 | def test_nointer(): |
| 256 | pass |
| 257 | """ |
| 258 | ) |
| 259 | rec = pytester.inline_run("-m", expr) |
| 260 | passed, skipped, fail = rec.listoutcomes() |
| 261 | passed_str = [x.nodeid.split("::")[-1] for x in passed] |
| 262 | assert passed_str == expected_passed |
| 263 | |
| 264 | |
| 265 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected