MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _func_fixture

Method _func_fixture

test/orm/test_query.py:2489–2510  ·  view source on GitHub ↗
(self, label=False)

Source from the content-addressed store, hash-verified

2487 self.mapper_registry.map_imperatively(Address, addresses)
2488
2489 def _func_fixture(self, label=False):
2490 User = self.classes.User
2491 users = self.tables.users
2492
2493 if label:
2494 self.mapper_registry.map_imperatively(
2495 User,
2496 users,
2497 properties={
2498 "foobar": column_property(
2499 func.foob(users.c.name).label(None)
2500 )
2501 },
2502 )
2503 else:
2504 self.mapper_registry.map_imperatively(
2505 User,
2506 users,
2507 properties={
2508 "foobar": column_property(func.foob(users.c.name))
2509 },
2510 )
2511
2512 def test_anon_label_function_auto(self):
2513 self._func_fixture()

Calls 4

column_propertyFunction · 0.90
map_imperativelyMethod · 0.80
foobMethod · 0.80
labelMethod · 0.45

Tested by

no test coverage detected