[Zope3-checkins] SVN: Zope3/trunk/src/zope/tales/tests/test_tales.py *Never* use the assert statement in a test case.

Jim Fulton jim at zope.com
Tue Aug 3 10:23:28 EDT 2004


Log message for revision 26875:
  *Never* use the assert statement in a test case.
  


Changed:
  U   Zope3/trunk/src/zope/tales/tests/test_tales.py


-=-
Modified: Zope3/trunk/src/zope/tales/tests/test_tales.py
===================================================================
--- Zope3/trunk/src/zope/tales/tests/test_tales.py	2004-08-03 14:06:15 UTC (rev 26874)
+++ Zope3/trunk/src/zope/tales/tests/test_tales.py	2004-08-03 14:23:28 UTC (rev 26875)
@@ -46,7 +46,7 @@
         for c in 'text':
             context._assert_('setLocal', 'text', c)
         for c in 'text':
-            assert it.next(), "Multi-element iterator"
+            self.assert_(it.next(), "Multi-element iterator")
         self.assert_( not it.next(), "Multi-element iterator")
         context._complete_()
 
@@ -140,7 +140,8 @@
         self._callstack.append((name, args, kwargs))
 
     def _complete_(self):
-        assert len(self._callstack) == 0, "Harness methods called"
+        self._testcase.assert_(len(self._callstack) == 0,
+                               "Harness methods called")
 
     def __getattr__(self, name):
         return HarnessMethod(self, name)



More information about the Zope3-Checkins mailing list