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

Method _assert_bind_args

test/orm/test_query.py:7621–7634  ·  view source on GitHub ↗
(self, session, expect_mapped_bind=True)

Source from the content-addressed store, hash-verified

7619
7620 @contextlib.contextmanager
7621 def _assert_bind_args(self, session, expect_mapped_bind=True):
7622 get_bind = mock.Mock(side_effect=session.get_bind)
7623 with mock.patch.object(session, "get_bind", get_bind):
7624 yield
7625 for call_ in get_bind.mock_calls:
7626 if expect_mapped_bind:
7627 eq_(
7628 call_,
7629 mock.call(
7630 clause=mock.ANY, mapper=inspect(self.classes.User)
7631 ),
7632 )
7633 else:
7634 eq_(call_, mock.call(clause=mock.ANY))
7635
7636 def test_single_entity_q(self):
7637 User = self.classes.User

Calls 3

eq_Function · 0.90
inspectFunction · 0.90
objectMethod · 0.80

Tested by

no test coverage detected