MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_basic_standalone

Method test_basic_standalone

test/orm/test_query.py:4629–4639  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4627
4628 @testing.emits_warning("Column-expression-level unary distinct")
4629 def test_basic_standalone(self):
4630 User = self.classes.User
4631
4632 # issue #6008. the UnaryExpression now places itself into the
4633 # result map so that it can be matched positionally without the need
4634 # for any label.
4635 q = fixture_session().query(distinct(User.id)).order_by(User.id)
4636 self.assert_compile(
4637 q, "SELECT DISTINCT users.id FROM users ORDER BY users.id"
4638 )
4639 eq_([(7,), (8,), (9,), (10,)], q.all())
4640
4641 @testing.emits_warning("Column-expression-level unary distinct")
4642 def test_standalone_w_subquery(self):

Callers

nothing calls this directly

Calls 7

fixture_sessionFunction · 0.90
distinctFunction · 0.90
eq_Function · 0.90
assert_compileMethod · 0.80
order_byMethod · 0.45
queryMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected