(self)
| 4564 | eq_(q.distinct().count(), 3) |
| 4565 | |
| 4566 | def test_cols_future(self): |
| 4567 | User, Address = self.classes.User, self.classes.Address |
| 4568 | |
| 4569 | s = fixture_session() |
| 4570 | |
| 4571 | stmt = select(func.count(distinct(User.name))) |
| 4572 | eq_( |
| 4573 | s.scalar(select(func.count()).select_from(stmt.subquery())), |
| 4574 | 1, |
| 4575 | ) |
| 4576 | |
| 4577 | stmt = select(func.count(distinct(User.name))).distinct() |
| 4578 | |
| 4579 | eq_( |
| 4580 | s.scalar(select(func.count()).select_from(stmt.subquery())), |
| 4581 | 1, |
| 4582 | ) |
| 4583 | |
| 4584 | stmt = select(User.name) |
| 4585 | eq_( |
| 4586 | s.scalar(select(func.count()).select_from(stmt.subquery())), |
| 4587 | 4, |
| 4588 | ) |
| 4589 | |
| 4590 | stmt = select(User.name, Address).join(Address, true()) |
| 4591 | eq_( |
| 4592 | s.scalar(select(func.count()).select_from(stmt.subquery())), |
| 4593 | 20, |
| 4594 | ) |
| 4595 | |
| 4596 | stmt = select(Address.user_id) |
| 4597 | eq_( |
| 4598 | s.scalar(select(func.count()).select_from(stmt.subquery())), |
| 4599 | 5, |
| 4600 | ) |
| 4601 | |
| 4602 | stmt = stmt.distinct() |
| 4603 | eq_( |
| 4604 | s.scalar(select(func.count()).select_from(stmt.subquery())), |
| 4605 | 3, |
| 4606 | ) |
| 4607 | |
| 4608 | |
| 4609 | class DistinctTest(QueryTest, AssertsCompiledSQL): |
nothing calls this directly
no test coverage detected