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

Method test_bytes_idval

testing/python/metafunc.py:342–352  ·  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

340 assert actual == expected
341
342 def test_bytes_idval(self) -> None:
343 """Unit test for the expected behavior to obtain ids for parametrized
344 bytes values: bytes objects are always escaped using "binary escape"."""
345 values = [
346 (b"", r""),
347 (b"\xc3\xb4\xff\xe4", r"\xc3\xb4\xff\xe4"),
348 (b"ascii", r"ascii"),
349 ("αρά".encode(), r"\xce\xb1\xcf\x81\xce\xac"),
350 ]
351 for val, expected in values:
352 assert _idval(val, "a", 6, idfn=None, nodeid=None, config=None) == expected
353
354 def test_class_or_function_idval(self) -> None:
355 """Unit test for the expected behavior to obtain ids for parametrized

Callers

nothing calls this directly

Calls 1

_idvalFunction · 0.90

Tested by

no test coverage detected