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

Method test_bytes_idval

testing/python/metafunc.py:401–413  ·  view source on GitHub ↗

Unit test for the expected behavior to obtain ids for parametrized bytes values: bytes objects are always escaped using "binary escape".

(self)

Source from the content-addressed store, hash-verified

399 assert actual == expected
400
401 def test_bytes_idval(self) -> None:
402 """Unit test for the expected behavior to obtain ids for parametrized
403 bytes values: bytes objects are always escaped using "binary escape"."""
404 values = [
405 (b"", r""),
406 (b"\xc3\xb4\xff\xe4", r"\xc3\xb4\xff\xe4"),
407 (b"ascii", r"ascii"),
408 ("αρά".encode(), r"\xce\xb1\xcf\x81\xce\xac"),
409 ]
410 for val, expected in values:
411 assert (
412 IdMaker([], [], None, None, None, None)._idval(val, "a", 6) == expected
413 )
414
415 def test_class_or_function_idval(self) -> None:
416 """Unit test for the expected behavior to obtain ids for parametrized

Callers

nothing calls this directly

Calls 2

IdMakerClass · 0.90
_idvalMethod · 0.80

Tested by

no test coverage detected