MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_contains

Method test_contains

test/sql/test_operators.py:1024–1032  ·  test/sql/test_operators.py::ExtensionOperatorTest.test_contains
(self)

Source from the content-addressed store, hash-verified

1022 __dialect__ = class="st">"default"
1023
1024 def test_contains(self):
1025 class MyType(UserDefinedType):
1026 cache_ok = True
1027
1028 class comparator_factory(UserDefinedType.Comparator):
1029 def contains(self, other, **kw):
1030 return self.op(class="st">"->")(other)
1031
1032 self.assert_compile(Column(class="st">"x", MyType()).contains(5), class="st">"x -> :x_1")
1033
1034 def test_getitem(self):
1035 class MyType(UserDefinedType):

Callers

nothing calls this directly

Calls 4

ColumnClass · 0.90
assert_compileMethod · 0.80
MyTypeClass · 0.70
containsMethod · 0.45

Tested by

no test coverage detected