| 3417 | is_not(b3.right, b4.right) |
| 3418 | |
| 3419 | def test_deannotate_clone(self): |
| 3420 | table1 = table("table1", column("col1"), column("col2")) |
| 3421 | |
| 3422 | subq = ( |
| 3423 | select(table1).where(table1.c.col1 == bindparam("foo")).subquery() |
| 3424 | ) |
| 3425 | stmt = select(subq) |
| 3426 | |
| 3427 | s2 = sql_util._deep_annotate(stmt, {"_orm_adapt": True}) |
| 3428 | s3 = sql_util._deep_deannotate(s2) |
| 3429 | s4 = sql_util._deep_deannotate(s3) |
| 3430 | |
| 3431 | eq_(stmt._annotations, {}) |
| 3432 | eq_(subq._annotations, {}) |
| 3433 | |
| 3434 | eq_(s2._annotations, {"_orm_adapt": True}) |
| 3435 | eq_(s3._annotations, {}) |
| 3436 | eq_(s4._annotations, {}) |
| 3437 | |
| 3438 | # select._raw_columns[0] is the subq object |
| 3439 | eq_(s2._raw_columns[0]._annotations, {"_orm_adapt": True}) |
| 3440 | eq_(s3._raw_columns[0]._annotations, {}) |
| 3441 | eq_(s4._raw_columns[0]._annotations, {}) |
| 3442 | |
| 3443 | is_not(s3, s2) |
| 3444 | is_not(s4, s3) # deep deannotate makes a clone unconditionally |
| 3445 | |
| 3446 | is_(s3._deannotate(), s3) # regular deannotate returns same object |
| 3447 | |
| 3448 | def test_annotate_unique_traversal(self): |
| 3449 | """test that items are copied only once during |