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

Method test_deannotate_wrapping

test/sql/test_selectable.py:3390–3417  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3388 )
3389
3390 def test_deannotate_wrapping(self):
3391 table1 = table("table1", column("col1"), column("col2"))
3392
3393 bin_ = table1.c.col1 == bindparam("foo", value=None)
3394
3395 b2 = sql_util._deep_annotate(bin_, {"_orm_adapt": True})
3396 b3 = sql_util._deep_deannotate(b2)
3397 b4 = sql_util._deep_deannotate(bin_)
3398
3399 for elem in (b2._annotations, b2.left._annotations):
3400 in_("_orm_adapt", elem)
3401
3402 for elem in (
3403 b3._annotations,
3404 b3.left._annotations,
3405 b4._annotations,
3406 b4.left._annotations,
3407 ):
3408 eq_(elem, {})
3409
3410 is_not(b2.left, bin_.left)
3411 is_not(b3.left, b2.left)
3412 is_not(b2.left, bin_.left)
3413 is_(b4.left, bin_.left) # since column is immutable
3414 # deannotate copies the element
3415 is_not(bin_.right, b2.right)
3416 is_not(b2.right, b3.right)
3417 is_not(b3.right, b4.right)
3418
3419 def test_deannotate_clone(self):
3420 table1 = table("table1", column("col1"), column("col2"))

Callers

nothing calls this directly

Calls 7

tableFunction · 0.90
columnFunction · 0.90
bindparamFunction · 0.90
in_Function · 0.90
eq_Function · 0.90
is_notFunction · 0.90
is_Function · 0.90

Tested by

no test coverage detected