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

Function test_parametrized_collected_from_command_line

testing/test_mark.py:390–403  ·  view source on GitHub ↗

Parametrized test not collected if test named specified in command line issue#649.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

388
389
390def test_parametrized_collected_from_command_line(pytester: Pytester) -> None:
391 """Parametrized test not collected if test named specified in command
392 line issue#649."""
393 py_file = pytester.makepyfile(
394 """
395 import pytest
396 @pytest.mark.parametrize("arg", [None, 1.3, "2-3"])
397 def test_func(arg):
398 pass
399 """
400 )
401 file_name = os.path.basename(py_file)
402 rec = pytester.inline_run(file_name + "::" + "test_func")
403 rec.assertoutcome(passed=3)
404
405
406def test_parametrized_collect_with_wrong_args(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected