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

Method test_basic_clone

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

Source from the content-addressed store, hash-verified

4057 __dialect__ = "default"
4058
4059 def test_basic_clone(self):
4060 t = table("t", column("c"))
4061 s = select(t).with_for_update(read=True, of=t.c.c)
4062 s2 = visitors.ReplacingCloningVisitor().traverse(s)
4063 assert s2._for_update_arg is not s._for_update_arg
4064 eq_(s2._for_update_arg.read, True)
4065 eq_(s2._for_update_arg.of, [t.c.c])
4066 self.assert_compile(
4067 s2, "SELECT t.c FROM t FOR SHARE OF t", dialect="postgresql"
4068 )
4069
4070 def test_adapt(self):
4071 t = table("t", column("c"))

Callers

nothing calls this directly

Calls 7

tableFunction · 0.90
columnFunction · 0.90
selectFunction · 0.90
eq_Function · 0.90
assert_compileMethod · 0.80
with_for_updateMethod · 0.45
traverseMethod · 0.45

Tested by

no test coverage detected