def test_should_complete_with_alembic_database_update( self, mock_commands_upgrade): tables = dict( alembic_version='version') # Mimic tables already created. engine = 'engine' # Invoke method under test. repositories._auto_generate_tables(engine, tables) mock_commands_upgrade.assert_called_once_with()