Unit test for expected behavior to obtain ids with disable_test_id_escaping_and_forfeit_all_rights_to_community_support option (#5294).
(self)
| 370 | ) |
| 371 | |
| 372 | def test_unicode_idval_with_config(self) -> None: |
| 373 | """Unit test for expected behavior to obtain ids with |
| 374 | disable_test_id_escaping_and_forfeit_all_rights_to_community_support |
| 375 | option (#5294).""" |
| 376 | |
| 377 | class MockConfig: |
| 378 | def __init__(self, config): |
| 379 | self.config = config |
| 380 | |
| 381 | @property |
| 382 | def hook(self): |
| 383 | return self |
| 384 | |
| 385 | def pytest_make_parametrize_id(self, **kw): |
| 386 | pass |
| 387 | |
| 388 | def getini(self, name): |
| 389 | return self.config[name] |
| 390 | |
| 391 | option = "disable_test_id_escaping_and_forfeit_all_rights_to_community_support" |
| 392 | |
| 393 | values: list[tuple[str, Any, str]] = [ |
| 394 | ("ação", MockConfig({option: True}), "ação"), |
| 395 | ("ação", MockConfig({option: False}), "a\\xe7\\xe3o"), |
| 396 | ] |
| 397 | for val, config, expected in values: |
| 398 | actual = IdMaker([], [], None, None, config, None)._idval(val, "a", 6) |
| 399 | assert actual == expected |
| 400 | |
| 401 | def test_bytes_idval(self) -> None: |
| 402 | """Unit test for the expected behavior to obtain ids for parametrized |
nothing calls this directly
no test coverage detected