Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
python-oslo.config
0001-Disable-deprecation-warning.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Disable-deprecation-warning.patch of Package python-oslo.config
From 43ef5855a1ff0ef68f13b9714ba2733d29535e92 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold <tbechtold@suse.com> Date: Mon, 19 Jan 2015 15:43:03 +0100 Subject: [PATCH] Disable deprecation warning --- oslo/config/__init__.py | 2 +- tests/test_warning.py | 61 ------------------------------------------------- 2 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 tests/test_warning.py diff --git a/oslo/config/__init__.py b/oslo/config/__init__.py index 331e0b0..6798a45 100644 --- a/oslo/config/__init__.py +++ b/oslo/config/__init__.py @@ -25,4 +25,4 @@ def deprecated(): ) -deprecated() +#deprecated() diff --git a/tests/test_warning.py b/tests/test_warning.py deleted file mode 100644 index 2c0bdbc..0000000 --- a/tests/test_warning.py +++ /dev/null @@ -1,61 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import imp -import os -import warnings - -import mock -from oslotest import base as test_base -import six - - -class DeprecationWarningTest(test_base.BaseTestCase): - - @mock.patch('warnings.warn') - def test_warning(self, mock_warn): - import oslo.config - imp.reload(oslo.config) - self.assertTrue(mock_warn.called) - args = mock_warn.call_args - self.assertIn('oslo_config', args[0][0]) - self.assertIn('deprecated', args[0][0]) - self.assertTrue(issubclass(args[0][1], DeprecationWarning)) - - def test_real_warning(self): - with warnings.catch_warnings(record=True) as warning_msgs: - warnings.resetwarnings() - warnings.simplefilter('always', DeprecationWarning) - import oslo.config - - # Use a separate function to get the stack level correct - # so we know the message points back to this file. This - # corresponds to an import or reload, which isn't working - # inside the test under Python 3.3. That may be due to a - # difference in the import implementation not triggering - # warnings properly when the module is reloaded, or - # because the warnings module is mostly implemented in C - # and something isn't cleanly resetting the global state - # used to track whether a warning needs to be - # emitted. Whatever the cause, we definitely see the - # warnings.warn() being invoked on a reload (see the test - # above) and warnings are reported on the console when we - # run the tests. A simpler test script run outside of - # testr does correctly report the warnings. - def foo(): - oslo.config.deprecated() - - foo() - self.assertEqual(1, len(warning_msgs)) - msg = warning_msgs[0] - self.assertIn('oslo_config', six.text_type(msg.message)) - self.assertEqual('test_warning.py', os.path.basename(msg.filename)) -- 2.2.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor