Fix database poison warnings, part 12

The following warning appears in the unit test logs a number of times.

    "UserWarning: This test uses methods that set internal oslo_db
state, but it does not claim to use the database. This will conflict
with the setup of tests that do use the database and cause failures
later."

This patch fixes the last two warnings from:

    unit.compute.test_compute_api.py

Note that this warning is only emitted once per unit test worker, so new
offenders will show up in the logs each time you fix a test until they
are all gone.

Change-Id: I8fefd8228f2aa9490cab943a79c50e76b1e66fa8
Related-Bug: #1568414
This commit is contained in:
Diana Clarke 2016-07-22 17:22:53 -04:00
parent 414df1e56e
commit e245086498
1 changed files with 2 additions and 1 deletions

View File

@ -166,10 +166,11 @@ class _ComputeAPIUnitTestMixIn(object):
@mock.patch('nova.conductor.conductor_api.ComputeTaskAPI.build_instances')
@mock.patch('nova.compute.api.API._record_action_start')
@mock.patch('nova.compute.api.API._check_requested_networks')
@mock.patch('nova.quota.QUOTAS.limit_check')
@mock.patch('nova.compute.api.API._get_image')
@mock.patch('nova.compute.api.API._provision_instances')
def test_create_with_networks_max_count_none(self, provision_instances,
get_image,
get_image, check_limit,
check_requested_networks,
record_action_start,
build_instances):