MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_eq_non_path

Method test_eq_non_path

test/orm/test_utils.py:869–892  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

867 is_(p1 != p5, True)
868
869 def test_eq_non_path(self):
870 umapper = inspect(self.classes.User)
871 amapper = inspect(self.classes.Address)
872 u_alias = inspect(aliased(self.classes.User))
873 p1 = PathRegistry.coerce((umapper,))
874 p2 = PathRegistry.coerce((umapper, umapper.attrs.addresses))
875 p3 = PathRegistry.coerce((u_alias, umapper.attrs.addresses))
876 p4 = PathRegistry.coerce((u_alias, umapper.attrs.addresses, amapper))
877 p5 = PathRegistry.coerce((u_alias,)).token(":*")
878
879 non_object = 54.1432
880
881 for obj in [p1, p2, p3, p4, p5]:
882 with expect_warnings(
883 "Comparison of PathRegistry to "
884 "<.* 'float'> is not supported"
885 ):
886 is_(obj == non_object, False)
887
888 with expect_warnings(
889 "Comparison of PathRegistry to "
890 "<.* 'float'> is not supported"
891 ):
892 is_(obj != non_object, True)
893
894 def test_contains_mapper(self):
895 umapper = inspect(self.classes.User)

Callers

nothing calls this directly

Calls 6

inspectFunction · 0.90
aliasedFunction · 0.90
expect_warningsFunction · 0.90
is_Function · 0.90
tokenMethod · 0.80
coerceMethod · 0.45

Tested by

no test coverage detected