mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
fixes dispatcher test that inadvertently access db
* Logger inadvertently triggered by dispatcher tests that do not need DB access. Mock settings to sidestep DB access.
This commit is contained in:
parent
119b9475ea
commit
906eb98d8e
@ -8,6 +8,7 @@ import tempfile
|
||||
import shutil
|
||||
from datetime import timedelta
|
||||
from six.moves import xrange
|
||||
from mock import PropertyMock
|
||||
|
||||
# Django
|
||||
from django.core.urlresolvers import resolve
|
||||
@ -752,3 +753,8 @@ def sqlite_copy_expert(request):
|
||||
request.addfinalizer(lambda: delattr(SQLiteCursorWrapper, 'copy_expert'))
|
||||
return path
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def disable_database_settings(mocker):
|
||||
m = mocker.patch('awx.conf.settings.SettingsWrapper.all_supported_settings', new_callable=PropertyMock)
|
||||
m.return_value = []
|
||||
|
||||
@ -55,6 +55,7 @@ class SlowResultWriter(BaseWorker):
|
||||
super(SlowResultWriter, self).perform_work(body, result_queue)
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("disable_database_settings")
|
||||
class TestPoolWorker:
|
||||
|
||||
def setup_method(self, test_method):
|
||||
@ -247,6 +248,7 @@ class TestAutoScaling:
|
||||
assert len(self.pool) == 2
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("disable_database_settings")
|
||||
class TestTaskDispatcher:
|
||||
|
||||
@property
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user