MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_dict_subclass2

Method test_dict_subclass2

test/orm/test_collection.py:1522–1534  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1520 self.assert_(getattr(MyDict, "_sa_instrumented") == id(MyDict))
1521
1522 def test_dict_subclass2(self):
1523 class MyEasyDict(collections.KeyFuncDict):
1524 def __init__(self, *args):
1525 super().__init__(lambda e: e.a, *args)
1526
1527 self._test_adapter(
1528 MyEasyDict, self.dictable_entity, to_set=lambda c: set(c.values())
1529 )
1530 self._test_dict(MyEasyDict)
1531 self._test_dict_bulk(MyEasyDict)
1532 self._test_dict_wo_mutation(MyEasyDict)
1533 self._test_dict_dataclasses(MyEasyDict)
1534 self.assert_(getattr(MyEasyDict, "_sa_instrumented") == id(MyEasyDict))
1535
1536 def test_dict_subclass3(self, ordered_dict_mro):
1537 class MyOrdered(ordered_dict_mro):

Callers

nothing calls this directly

Calls 7

_test_adapterMethod · 0.95
_test_dictMethod · 0.95
_test_dict_bulkMethod · 0.95
valuesMethod · 0.45
assert_Method · 0.45

Tested by

no test coverage detected