MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_non_cacheable_expr

Method test_non_cacheable_expr

test/orm/test_deferred.py:2286–2308  ·  view source on GitHub ↗

test #10990

(self)

Source from the content-addressed store, hash-verified

2284 eq_(c2.all(), [C(c_expr=4)])
2285
2286 def test_non_cacheable_expr(self):
2287 """test #10990"""
2288
2289 HasNonCacheable = self.classes.HasNonCacheable
2290
2291 for i in range(3):
2292 s = fixture_session()
2293
2294 stmt = (
2295 select(HasNonCacheable)
2296 .where(HasNonCacheable.created > 10)
2297 .options(
2298 with_expression(
2299 HasNonCacheable.msg_translated,
2300 HasNonCacheable.created + 10,
2301 )
2302 )
2303 )
2304
2305 eq_(
2306 s.scalars(stmt).all(),
2307 [HasNonCacheable(id=1, created=12345, msg_translated=12355)],
2308 )
2309
2310 def test_reuse_expr(self):
2311 A = self.classes.A

Callers

nothing calls this directly

Calls 9

fixture_sessionFunction · 0.90
selectFunction · 0.90
with_expressionFunction · 0.90
eq_Function · 0.90
HasNonCacheableClass · 0.85
optionsMethod · 0.45
whereMethod · 0.45
allMethod · 0.45
scalarsMethod · 0.45

Tested by

no test coverage detected