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

Method test_invalid_property

test/orm/test_query.py:6437–6452  ·  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

6435 ] == o
6436
6437 def test_invalid_property(self):
6438 """Test if with_parent is passed a non-relationship
6439
6440 found_during_type_annotation
6441
6442 """
6443 User = self.classes.User
6444
6445 sess = fixture_session()
6446 u1 = sess.get(User, 7)
6447 with expect_raises_message(
6448 sa_exc.ArgumentError,
6449 r"Expected relationship property for with_parent\(\), "
6450 "got User.name",
6451 ):
6452 with_parent(u1, User.name)
6453
6454 def test_select_from(self):
6455 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