MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_dict_subclass2

Method test_dict_subclass2

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

Source from the content-addressed store, hash-verified

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