Test collect parametrized func with wrong number of args.
(pytester: Pytester)
| 404 | |
| 405 | |
| 406 | def test_parametrized_collect_with_wrong_args(pytester: Pytester) -> None: |
| 407 | """Test collect parametrized func with wrong number of args.""" |
| 408 | py_file = pytester.makepyfile( |
| 409 | """ |
| 410 | import pytest |
| 411 | |
| 412 | @pytest.mark.parametrize('foo, bar', [(1, 2, 3)]) |
| 413 | def test_func(foo, bar): |
| 414 | pass |
| 415 | """ |
| 416 | ) |
| 417 | |
| 418 | result = pytester.runpytest(py_file) |
| 419 | result.stdout.fnmatch_lines( |
| 420 | [ |
| 421 | 'test_parametrized_collect_with_wrong_args.py::test_func: in "parametrize" the number of names (2):', |
| 422 | " ['foo', 'bar']", |
| 423 | "must be equal to the number of values (3):", |
| 424 | " (1, 2, 3)", |
| 425 | ] |
| 426 | ) |
| 427 | |
| 428 | |
| 429 | def test_parametrized_with_kwargs(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected