MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_config_errors

Method test_config_errors

test/orm/test_scoping.py:97–113  ·  test/orm/test_scoping.py::ScopedSessionTest.test_config_errors
(self)

Source from the content-addressed store, hash-verified

95 assert isinstance(SomeOtherObject.custom_query, query.Query)
96
97 def test_config_errors(self):
98 Session = scoped_session(sa.orm.sessionmaker())
99
100 s = Session() class="cm"># noqa
101 assert_raises_message(
102 sa.exc.InvalidRequestError,
103 class="st">"Scoped session is already present",
104 Session,
105 bind=testing.db,
106 )
107
108 assert_warns_message(
109 sa.exc.SAWarning,
110 class="st">"At least one scoped session is already present. ",
111 Session.configure,
112 bind=testing.db,
113 )
114
115 def test_call_with_kwargs(self):
116 mock_scope_func = Mock()

Callers

nothing calls this directly

Calls 4

scoped_sessionClass · 0.90
SessionClass · 0.90
assert_raises_messageFunction · 0.90
assert_warns_messageFunction · 0.90

Tested by

no test coverage detected