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

Method test_with_labels

test/orm/test_deprecations.py:633–645  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

631 )
632
633 def test_with_labels(self):
634 User = self.classes.User
635
636 with testing.expect_deprecated_20(
637 r"The Query.with_labels\(\) and Query.apply_labels\(\) "
638 "method is considered legacy"
639 ):
640 q = fixture_session().query(User).with_labels().statement
641
642 self.assert_compile(
643 q,
644 "SELECT users.id AS users_id, users.name AS users_name FROM users",
645 )
646
647
648class LazyLoadOptSpecificityTest(fixtures.DeclarativeMappedTest):

Callers

nothing calls this directly

Calls 4

fixture_sessionFunction · 0.90
with_labelsMethod · 0.80
assert_compileMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected