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

Method test_idmaker_autoname

testing/python/metafunc.py:439–464  ·  testing/python/metafunc.py::TestMetafunc.test_idmaker_autoname

#250

(self)

Source from the content-addressed store, hash-verified

437 assert IdMaker([], [], None, None, None, None)._idval(NOTSET, class="st">"a", 0) == class="st">"a0"
438
439 def test_idmaker_autoname(self) -> None:
440 class="st">""class="st">"class="cm">#250"class="st">""
441 result = IdMaker(
442 (class="st">"a", class="st">"b"),
443 [pytest.param(class="st">"string", 1.0), pytest.param(class="st">"st-ring", 2.0)],
444 None,
445 None,
446 None,
447 None,
448 ).make_unique_parameterset_ids()
449 assert result == [class="st">"string-1.0", class="st">"st-ring-2.0"]
450
451 result = IdMaker(
452 (class="st">"a", class="st">"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 == [class="st">"a0-1.0", class="st">"a1-b1"]
460 class="cm"># unicode mixing, issue250
461 result = IdMaker(
462 (class="st">"a", class="st">"b"), [pytest.param({}, bclass="st">"\xc3\xb4")], None, None, None, None
463 ).make_unique_parameterset_ids()
464 assert result == [class="st">"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