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

Method _func_fixture

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

Source from the content-addressed store, hash-verified

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