MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_parametrized_with_kwargs

Function test_parametrized_with_kwargs

testing/test_mark.py:429–446  ·  view source on GitHub ↗

Test collect parametrized func with wrong number of args.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

427
428
429def test_parametrized_with_kwargs(pytester: Pytester) -> None:
430 """Test collect parametrized func with wrong number of args."""
431 py_file = pytester.makepyfile(
432 """
433 import pytest
434
435 @pytest.fixture(params=[1,2])
436 def a(request):
437 return request.param
438
439 @pytest.mark.parametrize(argnames='b', argvalues=[1, 2])
440 def test_func(a, b):
441 pass
442 """
443 )
444
445 result = pytester.runpytest(py_file)
446 assert result.ret == 0
447
448
449def test_parametrize_iterator(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 2

makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected