()
| 521 | |
| 522 | @pytest.mark.thread_unsafe(reason='Flaky') |
| 523 | def test_config_wrapper_match(): |
| 524 | localns = { |
| 525 | '_GenerateSchema': GenerateSchema, |
| 526 | 'GenerateSchema': GenerateSchema, |
| 527 | 'JsonValue': JsonValue, |
| 528 | 'FieldInfo': FieldInfo, |
| 529 | 'ComputedFieldInfo': ComputedFieldInfo, |
| 530 | } |
| 531 | config_dict_annotations = [(k, str(v)) for k, v in get_type_hints(ConfigDict, localns=localns).items()] |
| 532 | config_dict_annotations.sort() |
| 533 | # remove config |
| 534 | config_wrapper_annotations = [ |
| 535 | (k, str(v)) for k, v in get_type_hints(ConfigWrapper, localns=localns).items() if k != 'config_dict' |
| 536 | ] |
| 537 | config_wrapper_annotations.sort() |
| 538 | |
| 539 | assert config_dict_annotations == config_wrapper_annotations, ( |
| 540 | 'ConfigDict and ConfigWrapper must have the same annotations (except ConfigWrapper.config_dict)' |
| 541 | ) |
| 542 | |
| 543 | |
| 544 | @pytest.mark.skipif(sys.version_info < (3, 11), reason='requires backport pre 3.11, fully tested in pydantic core') |
nothing calls this directly
no test coverage detected