[Checkins] SVN: zope.xmlpickle/trunk/src/zope/xmlpickle/tests/test_xmlpickle.py fixed test setup, use standard Python doctest
Thomas Lotze
tl at gocept.com
Wed Dec 15 08:56:55 EST 2010
Log message for revision 118931:
fixed test setup, use standard Python doctest
Changed:
U zope.xmlpickle/trunk/src/zope/xmlpickle/tests/test_xmlpickle.py
-=-
Modified: zope.xmlpickle/trunk/src/zope/xmlpickle/tests/test_xmlpickle.py
===================================================================
--- zope.xmlpickle/trunk/src/zope/xmlpickle/tests/test_xmlpickle.py 2010-12-15 13:51:02 UTC (rev 118930)
+++ zope.xmlpickle/trunk/src/zope/xmlpickle/tests/test_xmlpickle.py 2010-12-15 13:56:54 UTC (rev 118931)
@@ -14,10 +14,12 @@
"""Tests of xmlpickle package
"""
+import doctest
import pickle
import unittest
from zope.xmlpickle import dumps, loads
+
class Test(unittest.TestCase):
def __test(self, v, expected_xml=None):
@@ -251,7 +253,7 @@
class Simple:
"""This class is expected to be a classic class."""
-
+
def __init__(self, *a):
self.spam, self.eggs = a
@@ -264,13 +266,20 @@
def __repr__(self):
return '%s %r' % (self.__class__.__name__, self.__dict__)
+
class WInitial(Simple):
def __getinitargs__(self):
return self.spam, self.eggs
-class newSimple(Simple, object): pass
-class newWInitial(WInitial, object): pass
+class newSimple(Simple, object):
+ pass
+
+
+class newWInitial(WInitial, object):
+ pass
+
+
class DictSub(dict):
def __eq__(self, other):
items = self.items()
@@ -282,12 +291,9 @@
def __ne__(self, other):
return not self.__eq__(other)
+
def test_suite():
- from zope.testing.doctestunit import DocTestSuite
return unittest.TestSuite((
unittest.makeSuite(Test),
- DocTestSuite('zope.xmlpickle.xmlpickle'),
+ doctest.DocTestSuite('zope.xmlpickle.xmlpickle'),
))
-
-if __name__=='__main__':
- unittest.main(defaultTest='test_suite')
More information about the checkins
mailing list