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

Method test_idmaker_autoname

testing/python/metafunc.py:439–464  ·  view source on GitHub ↗

#250

(self)

Source from the content-addressed store, hash-verified

437 assert IdMaker([], [], None, None, None, None)._idval(NOTSET, "a", 0) == "a0"
438
439 def test_idmaker_autoname(self) -> None:
440 """#250"""
441 result = IdMaker(
442 ("a", "b"),
443 [pytest.param("string", 1.0), pytest.param("st-ring", 2.0)],
444 None,
445 None,
446 None,
447 None,
448 ).make_unique_parameterset_ids()
449 assert result == ["string-1.0", "st-ring-2.0"]
450
451 result = IdMaker(
452 ("a", "b"),
453 [pytest.param(object(), 1.0), pytest.param(object(), object())],
454 None,
455 None,
456 None,
457 None,
458 ).make_unique_parameterset_ids()
459 assert result == ["a0-1.0", "a1-b1"]
460 # unicode mixing, issue250
461 result = IdMaker(
462 ("a", "b"), [pytest.param({}, b"\xc3\xb4")], None, None, None, None
463 ).make_unique_parameterset_ids()
464 assert result == ["a0-\\xc3\\xb4"]
465
466 def test_idmaker_with_bytes_regex(self) -> None:
467 result = IdMaker(

Callers

nothing calls this directly

Calls 3

IdMakerClass · 0.90
paramMethod · 0.80

Tested by

no test coverage detected