MCPcopy
hub / github.com/msgspec/msgspec / test_classvar

Method test_classvar

tests/unit/test_struct.py:2602–2608  ·  view source on GitHub ↗
(self, case, future_annotations)

Source from the content-addressed store, hash-verified

2600 @pytest.mark.parametrize("case", [1, 2, 3, 4, 5])
2601 @pytest.mark.parametrize("future_annotations", [True, False])
2602 def test_classvar(self, case, future_annotations):
2603 source = getattr(self, f"case{case}")()
2604 if future_annotations:
2605 source = " from __future__ import annotations\n" + source
2606 with temp_module(source) as mod:
2607 assert mod.Ex.__struct_fields__ == ("a", "b")
2608 assert mod.Ex.cv2 == 1
2609
2610
2611class TestPostInit:

Callers

nothing calls this directly

Calls 1

temp_moduleFunction · 0.85

Tested by

no test coverage detected