MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_standalone

Method test_standalone

test/sql/test_tablesample.py:35–56  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 )
34
35 def test_standalone(self):
36 table1 = self.tables.people
37
38 # no special alias handling even though clause is not in the
39 # context of a FROM clause
40 self.assert_compile(
41 tablesample(table1, 1, name="alias"),
42 "people AS alias TABLESAMPLE system(:system_1)",
43 )
44
45 self.assert_compile(
46 table1.tablesample(1, name="alias"),
47 "people AS alias TABLESAMPLE system(:system_1)",
48 )
49
50 self.assert_compile(
51 tablesample(
52 table1, func.bernoulli(1), name="alias", seed=func.random()
53 ),
54 "people AS alias TABLESAMPLE bernoulli(:bernoulli_1) "
55 "REPEATABLE (random())",
56 )
57
58 def test_select_from(self):
59 table1 = self.tables.people

Callers

nothing calls this directly

Calls 4

tablesampleFunction · 0.90
assert_compileMethod · 0.80
tablesampleMethod · 0.80
randomMethod · 0.80

Tested by

no test coverage detected