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

Method test_start_increment

test/sql/test_sequences.py:415–426  ·  view source on GitHub ↗
(self, seq)

Source from the content-addressed store, hash-verified

413 (Sequence("foo_seq", increment=5),),
414 )
415 def test_start_increment(self, seq):
416 seq = normalize_sequence(config, seq)
417 seq.create(testing.db)
418 try:
419 with testing.db.connect() as conn:
420 values = [conn.scalar(seq) for i in range(3)]
421 start = seq.start or testing.db.dialect.default_sequence_base
422 inc = seq.increment or 1
423 eq_(values, list(range(start, start + inc * 3, inc)))
424
425 finally:
426 seq.drop(testing.db)
427
428 def _has_sequence(self, connection, name):
429 return testing.db.dialect.has_sequence(connection, name)

Callers

nothing calls this directly

Calls 6

normalize_sequenceFunction · 0.90
eq_Function · 0.90
createMethod · 0.45
connectMethod · 0.45
scalarMethod · 0.45
dropMethod · 0.45

Tested by

no test coverage detected