[Zope-Checkins] SVN: Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_ Add BBB markers and avoid tests to trigger deprecation warnings.

Philipp von Weitershausen philikon at philikon.de
Sun May 28 19:24:19 EDT 2006


Log message for revision 68323:
  Add BBB markers and avoid tests to trigger deprecation warnings.
  

Changed:
  U   Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_files.py
  U   Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_htmltalparser.py
  U   Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_sourcepos.py
  U   Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_talinterpreter.py
  U   Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_xmlparser.py

-=-
Modified: Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_files.py
===================================================================
--- Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_files.py	2006-05-28 23:15:46 UTC (rev 68322)
+++ Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_files.py	2006-05-28 23:24:18 UTC (rev 68323)
@@ -8,7 +8,7 @@
 from TAL.tests import utils
 import unittest
 
-from TAL import runtest
+from zope.tal import runtest
 
 class FileTestCase(unittest.TestCase):
 

Modified: Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_htmltalparser.py
===================================================================
--- Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_htmltalparser.py	2006-05-28 23:15:46 UTC (rev 68322)
+++ Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_htmltalparser.py	2006-05-28 23:24:18 UTC (rev 68323)
@@ -21,8 +21,18 @@
 import unittest
 
 
+# BBB 2005/05/01 -- to be changed after 12 months
+# ignore deprecation warnings on import for now
+import warnings
+showwarning = warnings.showwarning
+warnings.showwarning = lambda *a, **k: None
+# this old import should remain here until the TAL package is
+# completely removed, so that API backward compatibility is properly
+# tested
 from TAL import HTMLTALParser
 from TAL.TALDefs import TAL_VERSION, TALError, METALError
+# restore warning machinery
+warnings.showwarning = showwarning
 
 
 class TestCaseBase(unittest.TestCase):

Modified: Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_sourcepos.py
===================================================================
--- Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_sourcepos.py	2006-05-28 23:15:46 UTC (rev 68322)
+++ Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_sourcepos.py	2006-05-28 23:24:18 UTC (rev 68323)
@@ -6,10 +6,20 @@
 
 from StringIO import StringIO
 
+# BBB 2005/05/01 -- to be changed after 12 months
+# ignore deprecation warnings on import for now
+import warnings
+showwarning = warnings.showwarning
+warnings.showwarning = lambda *a, **k: None
+# this old import should remain here until the TAL package is
+# completely removed, so that API backward compatibility is properly
+# tested
 from TAL.HTMLTALParser import HTMLTALParser
 from TAL.TALInterpreter import TALInterpreter
 from TAL.TALGenerator import TALGenerator
 from TAL.DummyEngine import DummyEngine
+# restore warning machinery
+warnings.showwarning = showwarning
 
 
 page1 = '''<html metal:use-macro="main"><body>

Modified: Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_talinterpreter.py
===================================================================
--- Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_talinterpreter.py	2006-05-28 23:15:46 UTC (rev 68322)
+++ Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_talinterpreter.py	2006-05-28 23:24:18 UTC (rev 68323)
@@ -21,12 +21,24 @@
 
 from StringIO import StringIO
 
+# BBB 2005/05/01 -- to be changed after 12 months
+# ignore deprecation warnings on import for now
+import warnings
+showwarning = warnings.showwarning
+warnings.showwarning = lambda *a, **k: None
+# this old import should remain here until the TAL package is
+# completely removed, so that API backward compatibility is properly
+# tested
 from TAL.TALDefs import METALError, I18NError
 from TAL.HTMLTALParser import HTMLTALParser
 from TAL.TALParser import TALParser
 from TAL.TALInterpreter import TALInterpreter
 from TAL.DummyEngine import DummyEngine, DummyTranslationService
 from TAL.TALInterpreter import interpolate
+# restore warning machinery
+warnings.showwarning = showwarning
+
+
 from TAL.tests import utils
 from zope.i18nmessageid import Message
 

Modified: Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_xmlparser.py
===================================================================
--- Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_xmlparser.py	2006-05-28 23:15:46 UTC (rev 68322)
+++ Zope/branches/ajung-zpt-end-game/lib/python/TAL/tests/test_xmlparser.py	2006-05-28 23:24:18 UTC (rev 68323)
@@ -7,7 +7,17 @@
 from TAL.tests import utils
 import unittest
 
+# BBB 2005/05/01 -- to be changed after 12 months
+# ignore deprecation warnings on import for now
+import warnings
+showwarning = warnings.showwarning
+warnings.showwarning = lambda *a, **k: None
+# this old import should remain here until the TAL package is
+# completely removed, so that API backward compatibility is properly
+# tested
 from TAL import XMLParser
+# restore warning machinery
+warnings.showwarning = showwarning
 
 
 class EventCollector(XMLParser.XMLParser):



More information about the Zope-Checkins mailing list