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

Method test_idmaker_autoname

testing/python/metafunc.py:376–389  ·  view source on GitHub ↗

#250

(self)

Source from the content-addressed store, hash-verified

374 assert _idval(NOTSET, "a", 0, None, nodeid=None, config=None) == "a0"
375
376 def test_idmaker_autoname(self) -> None:
377 """#250"""
378 result = idmaker(
379 ("a", "b"), [pytest.param("string", 1.0), pytest.param("st-ring", 2.0)]
380 )
381 assert result == ["string-1.0", "st-ring-2.0"]
382
383 result = idmaker(
384 ("a", "b"), [pytest.param(object(), 1.0), pytest.param(object(), object())]
385 )
386 assert result == ["a0-1.0", "a1-b1"]
387 # unicode mixing, issue250
388 result = idmaker(("a", "b"), [pytest.param({}, b"\xc3\xb4")])
389 assert result == ["a0-\\xc3\\xb4"]
390
391 def test_idmaker_with_bytes_regex(self) -> None:
392 result = idmaker(("a"), [pytest.param(re.compile(b"foo"), 1.0)])

Callers

nothing calls this directly

Calls 2

idmakerFunction · 0.90
paramMethod · 0.80

Tested by

no test coverage detected