[Checkins] SVN: zope.deprecation/branches/chrism-unittesting/src/zope/deprecation/tests.py add tests for aliases
Chris McDonough
chrism at plope.com
Sun Sep 4 18:03:04 EST 2011
Log message for revision 122722:
add tests for aliases
Changed:
U zope.deprecation/branches/chrism-unittesting/src/zope/deprecation/tests.py
-=-
Modified: zope.deprecation/branches/chrism-unittesting/src/zope/deprecation/tests.py
===================================================================
--- zope.deprecation/branches/chrism-unittesting/src/zope/deprecation/tests.py 2011-09-04 23:01:27 UTC (rev 122721)
+++ zope.deprecation/branches/chrism-unittesting/src/zope/deprecation/tests.py 2011-09-04 23:03:04 UTC (rev 122722)
@@ -59,7 +59,7 @@
def tearDown(self):
from zope.deprecation import deprecation
deprecation.warnings = self.oldwarnings
- deprecation.show = self.oldshow
+ deprecation.__show__ = self.oldshow
class TestDeprecationProxy(WarningsSetupBase, unittest.TestCase):
def _getTargetClass(self):
@@ -442,6 +442,14 @@
'Import of zope.deprecation.tests will become unsupported in 1.3',
DeprecationWarning, 3)])
+class Test_import_aliases(unittest.TestCase):
+ def test_it(self):
+ for name in ('deprecated', 'deprecate', 'moved', 'ShowSwitch',
+ '__show__'):
+ real = getattr(sys.modules['zope.deprecation.deprecation'], name)
+ alias = getattr(sys.modules['zope.deprecation'], name)
+ self.assertEqual(real, alias, (real, alias))
+
class DummyWarningsModule(object):
def __init__(self):
self.w = []
More information about the checkins
mailing list