MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_invalid_property

Method test_invalid_property

test/orm/test_query.py:5912–5927  ·  view source on GitHub ↗

Test if with_parent is passed a non-relationship found_during_type_annotation

(self)

Source from the content-addressed store, hash-verified

5910 ] == o
5911
5912 def test_invalid_property(self):
5913 """Test if with_parent is passed a non-relationship
5914
5915 found_during_type_annotation
5916
5917 """
5918 User = self.classes.User
5919
5920 sess = fixture_session()
5921 u1 = sess.get(User, 7)
5922 with expect_raises_message(
5923 sa_exc.ArgumentError,
5924 r"Expected relationship property for with_parent\(\), "
5925 "got User.name",
5926 ):
5927 with_parent(u1, User.name)
5928
5929 def test_select_from(self):
5930 User, Address = self.classes.User, self.classes.Address

Callers

nothing calls this directly

Calls 4

fixture_sessionFunction · 0.90
expect_raises_messageFunction · 0.90
with_parentFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected