MCPcopy Create free account
hub / github.com/python/mypy / test_slot_key

Method test_slot_key

mypyc/test/test_emitclass.py:11–22  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9
10class TestEmitClass(unittest.TestCase):
11 def test_slot_key(self) -> None:
12 attrs = ["__add__", "__radd__", "__rshift__", "__rrshift__", "__setitem__", "__delitem__"]
13 s = sorted(attrs, key=lambda x: slot_key(x))
14 # __delitem__ and reverse methods should come last.
15 assert s == [
16 "__add__",
17 "__rshift__",
18 "__setitem__",
19 "__delitem__",
20 "__radd__",
21 "__rrshift__",
22 ]
23
24 def test_setter_name(self) -> None:
25 cls = ClassIR(module_name="testing", name="SomeClass")

Callers

nothing calls this directly

Calls 2

slot_keyFunction · 0.90
sortedFunction · 0.85

Tested by

no test coverage detected