[Checkins] SVN: Zope3/trunk/src/zope/app/site/tests/ Fixes #98535

Baiju M baiju.m.mail at gmail.com
Sat Apr 21 06:54:28 EDT 2007


Log message for revision 74318:
  Fixes #98535
  Use zope.deprecation to show deprecation of the module
  

Changed:
  U   Zope3/trunk/src/zope/app/site/tests/__init__.py
  A   Zope3/trunk/src/zope/app/site/tests/placefulsetup.py
  A   Zope3/trunk/src/zope/app/site/tests/test_deprecation.py

-=-
Modified: Zope3/trunk/src/zope/app/site/tests/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/site/tests/__init__.py	2007-04-21 10:33:37 UTC (rev 74317)
+++ Zope3/trunk/src/zope/app/site/tests/__init__.py	2007-04-21 10:54:28 UTC (rev 74318)
@@ -1,12 +1,5 @@
 import zope.deferredimport
 
-zope.deferredimport.deprecatedModule(
-    "zope.app.site.tests.placefulsetup",
-    "zope.app.component.testing",
-    "zope.app.site.tests.placefulsetup is deprecated and will go away "
-    "in Zope 3.5. Use zope.app.component.testing instead"
-    )
-
 zope.deferredimport.deprecated(
     "Import of PlacefulSetup from zope.app.site.testing is deprecated "
     "and will be disabled in Zope 3.5.  Import from "

Added: Zope3/trunk/src/zope/app/site/tests/placefulsetup.py
===================================================================
--- Zope3/trunk/src/zope/app/site/tests/placefulsetup.py	2007-04-21 10:33:37 UTC (rev 74317)
+++ Zope3/trunk/src/zope/app/site/tests/placefulsetup.py	2007-04-21 10:54:28 UTC (rev 74318)
@@ -0,0 +1,7 @@
+# This module has moved to zope.app.component.testing
+# and will go away in Zope 3.5
+import zope.deprecation
+zope.deprecation.moved(
+    'zope.app.component.testing',
+    "Zope 3.5",
+    )


Property changes on: Zope3/trunk/src/zope/app/site/tests/placefulsetup.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: Zope3/trunk/src/zope/app/site/tests/test_deprecation.py
===================================================================
--- Zope3/trunk/src/zope/app/site/tests/test_deprecation.py	2007-04-21 10:33:37 UTC (rev 74317)
+++ Zope3/trunk/src/zope/app/site/tests/test_deprecation.py	2007-04-21 10:54:28 UTC (rev 74318)
@@ -0,0 +1,45 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Test for https://bugs.launchpad.net/zope3/3.4/+bug/98535
+
+$Id$
+"""
+import unittest
+from zope.testing.doctestunit import DocTestSuite
+
+__docformat__ = "reStructuredText"
+
+def test_deprecation_of_placefulsetup():
+    """
+    >>> import warnings
+    >>> showwarning = warnings.showwarning
+    >>> warnings.showwarning = lambda *a, **k: None
+
+    >>> import zope.app.site.tests.placefulsetup
+    >>> placefulsetup = zope.app.site.tests.placefulsetup
+    >>> placefulsetup.__name__
+    'zope.app.site.tests.placefulsetup'
+    >>> placefulsetup.PlacefulSetup
+    <class 'zope.app.component.testing.PlacefulSetup'>
+
+    >>> warnings.showwarning = showwarning
+    """
+
+def test_suite():
+    return unittest.TestSuite([
+            DocTestSuite(),
+            ])
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')


Property changes on: Zope3/trunk/src/zope/app/site/tests/test_deprecation.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native



More information about the Checkins mailing list