MCPcopy
hub / github.com/pytest-dev/pytest / test_mark_option_with_kwargs

Function test_mark_option_with_kwargs

testing/test_mark.py:268–297  ·  view source on GitHub ↗
(
    expr: str, expected_passed: list[str | None], pytester: Pytester
)

Source from the content-addressed store, hash-verified

266 ids=str,
267)
268def 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(

Callers

nothing calls this directly

Calls 3

listoutcomesMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected