From 8d3f011f038d23b755f54dcbcf6edc9c4f36c8ca Mon Sep 17 00:00:00 2001 From: James Greenhill Date: Wed, 3 Jan 2024 14:35:26 -0800 Subject: [PATCH] improve test assert to actually be able to debug it when failes --- .../test/test_0010_move_old_partitions.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/posthog/async_migrations/test/test_0010_move_old_partitions.py b/posthog/async_migrations/test/test_0010_move_old_partitions.py index e6cafaaa48c5e..6396f0850193a 100644 --- a/posthog/async_migrations/test/test_0010_move_old_partitions.py +++ b/posthog/async_migrations/test/test_0010_move_old_partitions.py @@ -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 )