"""test_bulk_insert.py""" from __future__ import annotations import pytest pytest.importorskip("sqlalchemy") from bulk_insert import ROWS, build, count_statements, main def test_statement_counts() -> None: engine, table = build() loop_statements, loop_rows = count_statements(engine, table, bulk=False) engine, table = build() bulk_statements, bulk_rows = count_statements(engine, table, bulk=True) assert loop_rows == bulk_rows == ROWS assert loop_statements == ROWS assert bulk_statements == 1 def test_main_runs(capsys: pytest.CaptureFixture[str]) -> None: main() out = capsys.readouterr().out assert "loop_statements: 200" in out assert "bulk_statements: 1" in out