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

Method test_select_flags

test/orm/test_events.py:866–909  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

864 )
865
866 def test_select_flags(self):
867 User, Address = self.classes("User", "Address")
868
869 sess = Session(testing.db, future=True)
870
871 canary = self._flag_fixture(sess)
872
873 u1 = sess.execute(select(User).filter_by(id=7)).scalar_one()
874
875 sess.expire(u1)
876
877 eq_(u1.name, "jack")
878
879 eq_(
880 canary.mock_calls,
881 [
882 call.options(
883 bind_mapper=inspect(User),
884 all_mappers=[inspect(User)],
885 is_select=True,
886 is_from_statement=False,
887 is_insert=False,
888 is_update=False,
889 is_delete=False,
890 is_orm_statement=True,
891 is_relationship_load=False,
892 is_column_load=False,
893 lazy_loaded_from=None,
894 ),
895 call.options(
896 bind_mapper=inspect(User),
897 all_mappers=[inspect(User)],
898 is_select=True,
899 is_from_statement=False,
900 is_insert=False,
901 is_update=False,
902 is_delete=False,
903 is_orm_statement=True,
904 is_relationship_load=False,
905 is_column_load=True,
906 lazy_loaded_from=None,
907 ),
908 ],
909 )
910
911 def test_select_from_statement_flags(self):
912 User, Address = self.classes("User", "Address")

Callers

nothing calls this directly

Calls 10

_flag_fixtureMethod · 0.95
executeMethod · 0.95
expireMethod · 0.95
SessionClass · 0.90
selectFunction · 0.90
eq_Function · 0.90
inspectFunction · 0.90
scalar_oneMethod · 0.45
filter_byMethod · 0.45
optionsMethod · 0.45

Tested by

no test coverage detected