diff --git a/coriolisclient/tests/cli/test_diagnostics.py b/coriolisclient/tests/cli/test_diagnostics.py index 46d26c1..ba79c12 100644 --- a/coriolisclient/tests/cli/test_diagnostics.py +++ b/coriolisclient/tests/cli/test_diagnostics.py @@ -60,7 +60,8 @@ class GetCoriolisDiagnosticsTestCase(test_base.CoriolisBaseTestCase): def setUp(self, mock__init__): mock__init__.return_value = None super(GetCoriolisDiagnosticsTestCase, self).setUp() - self.diag = diagnostics.GetCoriolisDiagnostics() + self.diag = diagnostics.GetCoriolisDiagnostics( + mock.sentinel.app, mock.sentinel.app_args) @mock.patch.object(lister.Lister, 'get_parser') def test_get_parser(self, mock_get_parser): diff --git a/coriolisclient/tests/test_base.py b/coriolisclient/tests/test_base.py index af448cc..7c8c9b1 100644 --- a/coriolisclient/tests/test_base.py +++ b/coriolisclient/tests/test_base.py @@ -4,6 +4,13 @@ """Defines base class for all tests.""" from oslotest import base +from oslotest import mock_fixture + +# NOTE(claudiub): this needs to be called before any mock.patch calls are +# being done, and especially before any other test classes load. This fixes +# the mock.patch autospec issue: +# https://github.com/testing-cabal/mock/issues/396 +mock_fixture.patch_mock_module() class CoriolisBaseTestCase(base.BaseTestCase):