Skip to content

Commit

Permalink
improve test assert to actually be able to debug it when failes
Browse files Browse the repository at this point in the history
  • Loading branch information
fuziontech committed Jan 3, 2024
1 parent e1021cb commit 8d3f011
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions posthog/async_migrations/test/test_0010_move_old_partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ def test_completes_successfully(self):
# create table + 3 move operations
self.assertEqual(len(MIGRATION_DEFINITION.operations), 5)

self.assertTrue(
"ALTER TABLE sharded_events MOVE PARTITION '190001' TO TABLE events_backup"
in MIGRATION_DEFINITION.operations[1].sql # type: ignore
self.assertIn(
"ALTER TABLE sharded_events MOVE PARTITION '190001' TO TABLE events_backup",
MIGRATION_DEFINITION.operations[1].sql, # type: ignore
)
self.assertTrue(
"ALTER TABLE sharded_events MOVE PARTITION '202201' TO TABLE events_backup"
in MIGRATION_DEFINITION.operations[2].sql # type: ignore
self.assertIn(
"ALTER TABLE sharded_events MOVE PARTITION '202201' TO TABLE events_backup",
MIGRATION_DEFINITION.operations[2].sql, # type: ignore
)
self.assertTrue(
"ALTER TABLE sharded_events MOVE PARTITION '202202' TO TABLE events_backup"
in MIGRATION_DEFINITION.operations[2].sql # type: ignore
self.assertIn(
"ALTER TABLE sharded_events MOVE PARTITION '202202' TO TABLE events_backup",
MIGRATION_DEFINITION.operations[2].sql, # type: ignore
)
self.assertTrue(
"ALTER TABLE sharded_events MOVE PARTITION '204502' TO TABLE events_backup"
in MIGRATION_DEFINITION.operations[3].sql # type: ignore
self.assertIn(
"ALTER TABLE sharded_events MOVE PARTITION '204502' TO TABLE events_backup",
MIGRATION_DEFINITION.operations[3].sql, # type: ignore
)

0 comments on commit 8d3f011

Please sign in to comment.