(val: Union[str, bytes], config: Optional[Config])
| 1348 | |
| 1349 | |
| 1350 | def _ascii_escaped_by_config(val: Union[str, bytes], config: Optional[Config]) -> str: |
| 1351 | if config is None: |
| 1352 | escape_option = False |
| 1353 | else: |
| 1354 | escape_option = config.getini( |
| 1355 | "disable_test_id_escaping_and_forfeit_all_rights_to_community_support" |
| 1356 | ) |
| 1357 | # TODO: If escaping is turned off and the user passes bytes, |
| 1358 | # will return a bytes. For now we ignore this but the |
| 1359 | # code *probably* doesn't handle this case. |
| 1360 | return val if escape_option else ascii_escaped(val) # type: ignore |
| 1361 | |
| 1362 | |
| 1363 | def _idval( |
no test coverage detected