MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_start_increment

Method test_start_increment

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

Source from the content-addressed store, hash-verified

407 (Sequence("foo_seq", increment=5),),
408 )
409 def test_start_increment(self, seq):
410 seq = normalize_sequence(config, seq)
411 seq.create(testing.db)
412 try:
413 with testing.db.connect() as conn:
414 values = [conn.scalar(seq) for i in range(3)]
415 start = seq.start or testing.db.dialect.default_sequence_base
416 inc = seq.increment or 1
417 eq_(values, list(range(start, start + inc * 3, inc)))
418
419 finally:
420 seq.drop(testing.db)
421
422 def _has_sequence(self, connection, name):
423 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