MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_eq_non_path

Method test_eq_non_path

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

Source from the content-addressed store, hash-verified

883 is_(p1 != p5, True)
884
885 def test_eq_non_path(self):
886 umapper = inspect(self.classes.User)
887 amapper = inspect(self.classes.Address)
888 u_alias = inspect(aliased(self.classes.User))
889 p1 = PathRegistry.coerce((umapper,))
890 p2 = PathRegistry.coerce((umapper, umapper.attrs.addresses))
891 p3 = PathRegistry.coerce((u_alias, umapper.attrs.addresses))
892 p4 = PathRegistry.coerce((u_alias, umapper.attrs.addresses, amapper))
893 p5 = PathRegistry.coerce((u_alias,)).token("relationship:*")
894
895 non_object = 54.1432
896
897 for obj in [p1, p2, p3, p4, p5]:
898 with expect_warnings(
899 "Comparison of PathRegistry to "
900 "<.* 'float'> is not supported"
901 ):
902 is_(obj == non_object, False)
903
904 with expect_warnings(
905 "Comparison of PathRegistry to "
906 "<.* 'float'> is not supported"
907 ):
908 is_(obj != non_object, True)
909
910 def test_contains_mapper(self):
911 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