From 108dc3795eaffbeafed255c14b0c00001b21ca2d Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 23 Jul 2024 09:39:27 +0200 Subject: [PATCH] Remove incorrect use of Mock.assert_has_calls from recorder tests (#122439) * Remove incorrect use of Mock.assert_has_calls from recorder tests * Fix test --- tests/components/recorder/test_migrate.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/components/recorder/test_migrate.py b/tests/components/recorder/test_migrate.py index d753f908e76..3eea231a659 100644 --- a/tests/components/recorder/test_migrate.py +++ b/tests/components/recorder/test_migrate.py @@ -83,17 +83,15 @@ async def test_schema_update_calls( instance = recorder.get_instance(hass) engine = instance.engine session_maker = instance.get_session - update.assert_has_calls( - [ - call(instance, hass, engine, session_maker, version + 1, 0) - for version in range(db_schema.SCHEMA_VERSION) - ] - ) - migrate_schema.assert_has_calls( - [ - call(instance, hass, engine, session_maker, ANY, db_schema.SCHEMA_VERSION), - ] - ) + assert update.mock_calls == [ + call(instance, hass, engine, session_maker, version + 1, 0) + for version in range(db_schema.SCHEMA_VERSION) + ] + status = migration.SchemaValidationStatus(0, True, set(), 0) + assert migrate_schema.mock_calls == [ + call(instance, hass, engine, session_maker, status, 0), + call(instance, hass, engine, session_maker, status, db_schema.SCHEMA_VERSION), + ] async def test_migration_in_progress(