MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_execute_deprecated

Method test_execute_deprecated

test/sql/test_sequences.py:163–171  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

161 self._assert_seq_result(connection.scalar(s))
162
163 def test_execute_deprecated(self, connection):
164 s = normalize_sequence(config, Sequence("my_sequence", optional=True))
165
166 with expect_deprecated(
167 r"Using the .execute\(\) method to invoke a "
168 r"DefaultGenerator object is deprecated; please use "
169 r"the .scalar\(\) method."
170 ):
171 self._assert_seq_result(connection.execute(s))
172
173 def test_scalar_optional(self, connection):
174 """test dialect executes a Sequence, returns nextval, whether

Callers

nothing calls this directly

Calls 5

_assert_seq_resultMethod · 0.95
normalize_sequenceFunction · 0.90
SequenceClass · 0.90
expect_deprecatedFunction · 0.90
executeMethod · 0.45

Tested by

no test coverage detected