MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_basic_clone

Method test_basic_clone

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

Source from the content-addressed store, hash-verified

4044 __dialect__ = "default"
4045
4046 def test_basic_clone(self):
4047 t = table("t", column("c"))
4048 s = select(t).with_for_update(read=True, of=t.c.c)
4049 s2 = visitors.ReplacingCloningVisitor().traverse(s)
4050 assert s2._for_update_arg is not s._for_update_arg
4051 eq_(s2._for_update_arg.read, True)
4052 eq_(s2._for_update_arg.of, [t.c.c])
4053 self.assert_compile(
4054 s2, "SELECT t.c FROM t FOR SHARE OF t", dialect="postgresql"
4055 )
4056
4057 def test_adapt(self):
4058 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