MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / setup_mappers

Method setup_mappers

test/ext/test_mutable.py:1732–1745  ·  test/ext/test_mutable.py::MutableCompositeCallableTest.setup_mappers
(cls)

Source from the content-addressed store, hash-verified

1730class MutableCompositeCallableTest(_CompositeTestBase, fixtures.MappedTest):
1731 @classmethod
1732 def setup_mappers(cls):
1733 foo = cls.tables.foo
1734
1735 Point = cls._type_fixture()
1736
1737 class="cm"># in this case, this is not actually a MutableComposite.
1738 class="cm"># so we don't expect it to track changes
1739 cls.mapper_registry.map_imperatively(
1740 Foo,
1741 foo,
1742 properties={
1743 class="st">"data": composite(lambda x, y: Point(x, y), foo.c.x, foo.c.y)
1744 },
1745 )
1746
1747 def test_basic(self):
1748 sess = fixture_session()

Callers

nothing calls this directly

Calls 4

compositeFunction · 0.90
map_imperativelyMethod · 0.80
PointClass · 0.70
_type_fixtureMethod · 0.45

Tested by

no test coverage detected