(
expr: str, expected_passed: list[str | None], pytester: Pytester
)
| 266 | ids=str, |
| 267 | ) |
| 268 | def test_mark_option_with_kwargs( |
| 269 | expr: str, expected_passed: list[str | None], pytester: Pytester |
| 270 | ) -> None: |
| 271 | pytester.makepyfile( |
| 272 | """ |
| 273 | import pytest |
| 274 | @pytest.mark.car |
| 275 | @pytest.mark.car(ac=True) |
| 276 | @pytest.mark.car(temp=4) |
| 277 | @pytest.mark.car(color="red") |
| 278 | def test_one(): |
| 279 | pass |
| 280 | @pytest.mark.car |
| 281 | @pytest.mark.car(ac=False) |
| 282 | @pytest.mark.car(temp=5) |
| 283 | @pytest.mark.car(color="blue") |
| 284 | def test_two(): |
| 285 | pass |
| 286 | @pytest.mark.car |
| 287 | @pytest.mark.car(ac=None) |
| 288 | @pytest.mark.car(temp=-5) |
| 289 | def test_three(): |
| 290 | pass |
| 291 | |
| 292 | """ |
| 293 | ) |
| 294 | rec = pytester.inline_run("-m", expr) |
| 295 | passed, _skipped, _fail = rec.listoutcomes() |
| 296 | passed_str = [x.nodeid.split("::")[-1] for x in passed] |
| 297 | assert passed_str == expected_passed |
| 298 | |
| 299 | |
| 300 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected