MCPcopy Create free account
hub / github.com/msgspec/msgspec / test_eval_scopes

Method test_eval_scopes

tests/unit/test_utils.py:30–43  ·  view source on GitHub ↗
(self, future_annotations)

Source from the content-addressed store, hash-verified

28class TestGetClassAnnotations:
29 @pytest.mark.parametrize("future_annotations", [False, True])
30 def test_eval_scopes(self, future_annotations):
31 header = "from __future__ import annotations" if future_annotations else ""
32 source = f"""
33 {header}
34 STR = str
35
36 class Ex:
37 LOCAL = float
38 x: int
39 y: LOCAL
40 z: STR
41 """
42 with temp_module(source) as mod:
43 assert get_class_annotations(mod.Ex) == {"x": int, "y": float, "z": str}
44
45 def test_none_to_nonetype(self):
46 class Ex:

Callers

nothing calls this directly

Calls 2

get_class_annotationsFunction · 0.90
temp_moduleFunction · 0.85

Tested by

no test coverage detected