← Về thư mục
tests/test_schema_migrations.py
- _schema_sql · function · L47-L51 — def _schema_sql() -> str
- plain_db · function · L55-L63 — def plain_db(tmp_path)
- test_a_new_store_is_stamped_and_recorded · function · L71-L166 — def test_a_new_store_is_stamped_and_recorded(tmp_path)
- test_an_unversioned_database_reports_version_zero · function · L169-L171 — def test_an_unversioned_database_reports_version_zero(plain_db)
- test_reopening_a_current_database_does_no_work · function · L174-L193 — def test_reopening_a_current_database_does_no_work(tmp_path, monkeypatch)
- test_v24_installs_both_halves_of_trusted_artifact_delivery · function · L196-L228 — def test_v24_installs_both_halves_of_trusted_artifact_delivery(tmp_path)
- test_v24_combined_schema_step_rolls_back_if_second_half_fails · function · L231-L268 — def test_v24_combined_schema_step_rolls_back_if_second_half_fails(tmp_path)
- interrupted_step · function · L242-L244 — def interrupted_step(connection)
- _downgrade_current_store_to_v24 · function · L283-L427 — def _downgrade_current_store_to_v24(tmp_path, name="v24.db")
- test_v25_upgrades_a_real_v24_store_preserving_data_and_checkpoint_envelope · function · L430-L565 — def test_v25_upgrades_a_real_v24_store_preserving_data_and_checkpoint_envelope( tmp_path, )
- test_v25_late_failure_rolls_back_all_tables_triggers_cursor_and_version · function · L568-L701 — def test_v25_late_failure_rolls_back_all_tables_triggers_cursor_and_version(tmp_path)
- fail_after_complete_v25_schema · function · L575-L633 — def fail_after_complete_v25_schema(conn)
- test_partial_v25_repair_bindings_are_backfilled_and_rebuilt_canonically · function · L704-L824 — def test_partial_v25_repair_bindings_are_backfilled_and_rebuilt_canonically( tmp_path, )
- _downgrade_current_store_to_v27 · function · L844-L975 — def _downgrade_current_store_to_v27(tmp_path, name="v27.db")
- test_v28_upgrades_a_real_v27_store_preserving_rows_and_new_columns · function · L978-L1033 — def test_v28_upgrades_a_real_v27_store_preserving_rows_and_new_columns(tmp_path)
- _make_legacy_db · function · L1041-L1063 — def _make_legacy_db(tmp_path) -> Path
- test_an_upgraded_db_gains_owner_key_and_can_create_compute_jobs · function · L1066-L1107 — def test_an_upgraded_db_gains_owner_key_and_can_create_compute_jobs(tmp_path)
- test_legacy_database_is_migrated_and_stamped · function · L1110-L1123 — def test_legacy_database_is_migrated_and_stamped(tmp_path)
- test_legacy_migration_preserves_data_and_backfills · function · L1126-L1137 — def test_legacy_migration_preserves_data_and_backfills(tmp_path)
- test_the_legacy_baseline_is_idempotent · function · L1140-L1165 — def test_the_legacy_baseline_is_idempotent(tmp_path)
- test_an_upgrade_repairs_bad_rows_before_stamping_the_version · function · L1168-L1199 — def test_an_upgrade_repairs_bad_rows_before_stamping_the_version(tmp_path)
- test_successful_migration_cleans_up_its_backup · function · L1202-L1208 — def test_successful_migration_cleans_up_its_backup(tmp_path)
- test_a_failing_step_rolls_back_the_whole_set · function · L1216-L1234 — def test_a_failing_step_rolls_back_the_whole_set(plain_db)
- step_ok · function · L1221-L1223 — def step_ok(c)
- step_boom · function · L1225-L1227 — def step_boom(c)
- test_ddl_really_is_transactional · function · L1237-L1252 — def test_ddl_really_is_transactional(plain_db)
- add_then_fail · function · L1246-L1248 — def add_then_fail(c)
- test_bare_ddl_outside_a_transaction_would_not_roll_back · function · L1255-L1265 — def test_bare_ddl_outside_a_transaction_would_not_roll_back(plain_db)
- test_a_migration_leaves_no_transaction_open · function · L1268-L1273 — def test_a_migration_leaves_no_transaction_open(plain_db)
- test_a_failed_migration_leaves_no_transaction_open · function · L1276-L1285 — def test_a_failed_migration_leaves_no_transaction_open(plain_db)
- boom · function · L1279-L1281 — def boom(c)
- test_a_failed_migration_keeps_its_backup · function · L1288-L1296 — def test_a_failed_migration_keeps_its_backup(plain_db)
- boom · function · L1291-L1292 — def boom(c)
- test_rerunning_after_a_failure_is_safe · function · L1299-L1313 — def test_rerunning_after_a_failure_is_safe(plain_db)
- flaky · function · L1303-L1306 — def flaky(c)
- test_duplicate_column_is_the_only_benign_operational_error · function · L1321-L1331 — def test_duplicate_column_is_the_only_benign_operational_error()
- test_a_real_alter_failure_is_not_swallowed · function · L1334-L1348 — def test_a_real_alter_failure_is_not_swallowed(tmp_path, monkeypatch)
- test_the_database_is_untouched_after_a_failed_alter · function · L1351-L1370 — def test_the_database_is_untouched_after_a_failed_alter(tmp_path, monkeypatch)
- test_v16_datapro_tables_are_created_only_inside_the_migration_transaction · function · L1373-L1416 — def test_v16_datapro_tables_are_created_only_inside_the_migration_transaction( tmp_path, monkeypatch )
- create_then_fail · function · L1395-L1398 — def create_then_fail(self, connection)
- test_v17_repairs_a_v16_database_missing_datapro_index_tables · function · L1419-L1442 — def test_v17_repairs_a_v16_database_missing_datapro_index_tables(tmp_path)
- test_migration_refuses_a_corrupt_database · function · L1450-L1459 — def test_migration_refuses_a_corrupt_database(plain_db, monkeypatch)
- test_integrity_ok_on_a_healthy_database · function · L1462-L1464 — def test_integrity_ok_on_a_healthy_database(plain_db)
- test_backup_uses_the_sqlite_api_not_a_file_copy · function · L1467-L1478 — def test_backup_uses_the_sqlite_api_not_a_file_copy(plain_db)
- test_no_backup_for_a_database_with_nothing_to_lose · function · L1481-L1482 — def test_no_backup_for_a_database_with_nothing_to_lose(tmp_path)
- test_backup_is_owner_only · function · L1485-L1495 — def test_backup_is_owner_only(plain_db)
- test_foreign_keys_is_on · function · L1503-L1508 — def test_foreign_keys_is_on(tmp_path)
- test_busy_timeout_is_set · function · L1511-L1513 — def test_busy_timeout_is_set(tmp_path)
- test_synchronous_stays_full · function · L1516-L1520 — def test_synchronous_stays_full(tmp_path)
- _legacy_env_snapshot · function · L1528-L1557 — def _legacy_env_snapshot(db: Path, snapshot_id: str, generation_id: str) -> None
- _rewind_to_version_six · function · L1560-L1568 — def _rewind_to_version_six(db: Path) -> None
- test_an_unverifiable_generation_attribution_is_labelled_not_erased · function · L1571-L1591 — def test_an_unverifiable_generation_attribution_is_labelled_not_erased(tmp_path)
- test_a_correctly_addressed_row_is_labelled_verified · function · L1594-L1620 — def test_a_correctly_addressed_row_is_labelled_verified(tmp_path)
- test_storage_readmes_name_the_migration_numbers_the_code_uses · function · L1623-L1664 — def test_storage_readmes_name_the_migration_numbers_the_code_uses(tmp_path)
- _schema_objects · function · L1667-L1674 — def _schema_objects(path: Path) -> set[tuple[str, str]]
- test_an_upgrade_backs_up_before_any_schema_write_and_a_failure_changes_nothing · function · L1677-L1725 — def test_an_upgrade_backs_up_before_any_schema_write_and_a_failure_changes_nothing( tmp_path, monkeypatch )
- spy · function · L1703-L1705 — def spy(path, version)
- interrupted · function · L1707-L1712 — def interrupted(_self, connection)
- test_future_schema_is_refused_before_any_store_initialization_write · function · L1728-L1759 — def test_future_schema_is_refused_before_any_store_initialization_write( tmp_path, monkeypatch )
- test_run_migrations_independently_refuses_a_future_version · function · L1762-L1771 — def test_run_migrations_independently_refuses_a_future_version(plain_db)
- test_future_schema_committed_only_in_wal_is_visible_to_preflight · function · L1774-L1800 — def test_future_schema_committed_only_in_wal_is_visible_to_preflight(tmp_path)
- test_formal_store_connection_rechecks_version_and_closes_on_failure · function · L1803-L1847 — def test_formal_store_connection_rechecks_version_and_closes_on_failure( tmp_path, monkeypatch )
- change_after_preflight · function · L1822-L1825 — def change_after_preflight(db)
- record_connection · function · L1827-L1830 — def record_connection(args, *kwargs)
- test_corrupt_preflight_is_not_misclassified_as_future_and_does_not_write · function · L1850-L1860 — def test_corrupt_preflight_is_not_misclassified_as_future_and_does_not_write(tmp_path)
- test_schema_state_is_current_only_for_equal_version · function · L1863-L1870 — def test_schema_state_is_current_only_for_equal_version(tmp_path)
- _leave_hot_rollback_journal · function · L1873-L1906 — def _leave_hot_rollback_journal(path: Path) -> None
- test_hot_rollback_journal_is_replayed_by_the_formal_open_not_refused · function · L1909-L1934 — def test_hot_rollback_journal_is_replayed_by_the_formal_open_not_refused(tmp_path)
- test_hot_rollback_journal_does_not_bypass_the_future_schema_refusal · function · L1937-L1949 — def test_hot_rollback_journal_does_not_bypass_the_future_schema_refusal(tmp_path)