(self, custom, op, fwd_op, rev_op)
| 1865 | argnames="op, fwd_op, rev_op", |
| 1866 | ) |
| 1867 | def test_comparator_null(self, custom, op, fwd_op, rev_op): |
| 1868 | self._fixture(custom) |
| 1869 | Edge, Point = self.classes("Edge", "Point") |
| 1870 | |
| 1871 | if op is operator.eq: |
| 1872 | self.assert_compile( |
| 1873 | select(Edge).filter(op(Edge.start, None)), |
| 1874 | "SELECT edge.id, edge.x1, edge.y1, edge.x2, edge.y2 FROM edge " |
| 1875 | "WHERE edge.x1 IS NULL AND edge.y1 IS NULL", |
| 1876 | checkparams={}, |
| 1877 | ) |
| 1878 | elif op is operator.ne: |
| 1879 | self.assert_compile( |
| 1880 | select(Edge).filter(op(Edge.start, None)), |
| 1881 | "SELECT edge.id, edge.x1, edge.y1, edge.x2, edge.y2 FROM edge " |
| 1882 | "WHERE edge.x1 IS NOT NULL AND edge.y1 IS NOT NULL", |
| 1883 | checkparams={}, |
| 1884 | ) |
| 1885 | else: |
| 1886 | with expect_raises_message( |
| 1887 | sa.exc.ArgumentError, |
| 1888 | r"Only '=', '!=', .* operators can be used " |
| 1889 | r"with None/True/False", |
| 1890 | ): |
| 1891 | select(Edge).filter(op(Edge.start, None)) |
| 1892 | |
| 1893 | def test_default_comparator_factory(self): |
| 1894 | self._fixture(False) |
nothing calls this directly
no test coverage detected