[Checkins] SVN: z3c.schemadiff/trunk/ - Using Python's ``doctest`` module instead of depreacted

Michael Howitz mh at gocept.com
Tue Oct 19 02:46:11 EDT 2010


Log message for revision 117739:
  - Using Python's ``doctest`` module instead of depreacted
    ``zope.testing.doctest``.
  
  - Added test extra to declare test dependency on ``zope.component [test]``.
  

Changed:
  U   z3c.schemadiff/trunk/CHANGES.txt
  U   z3c.schemadiff/trunk/buildout.cfg
  U   z3c.schemadiff/trunk/setup.py
  U   z3c.schemadiff/trunk/src/z3c/schemadiff/tests.py

-=-
Modified: z3c.schemadiff/trunk/CHANGES.txt
===================================================================
--- z3c.schemadiff/trunk/CHANGES.txt	2010-10-19 06:40:00 UTC (rev 117738)
+++ z3c.schemadiff/trunk/CHANGES.txt	2010-10-19 06:46:10 UTC (rev 117739)
@@ -1,7 +1,8 @@
 Changelog
 =========
 
-In next release:
+0.2 (unreleased)
+----------------
 
 - The ``IFieldDiff`` interface now allows for a ``html_diff`` method
   which will be used if the ``lines`` method is unavailable. This can
@@ -12,9 +13,14 @@
 
 - Drop field if either value is ``None``. [malthe]
 
-- Use field.query instead of getattr
+- Use field.query instead of getattr.
 
+- Using Python's ``doctest`` module instead of depreacted
+  ``zope.testing.doctest``.
 
+- Added test extra to declare test dependency on ``zope.component [test]``.
+
+
 0.1 (2008-04-30)
 ----------------
 

Modified: z3c.schemadiff/trunk/buildout.cfg
===================================================================
--- z3c.schemadiff/trunk/buildout.cfg	2010-10-19 06:40:00 UTC (rev 117738)
+++ z3c.schemadiff/trunk/buildout.cfg	2010-10-19 06:46:10 UTC (rev 117739)
@@ -4,5 +4,5 @@
 
 [test]
 recipe = zc.recipe.testrunner
-eggs = z3c.schemadiff
+eggs = z3c.schemadiff [test]
 

Modified: z3c.schemadiff/trunk/setup.py
===================================================================
--- z3c.schemadiff/trunk/setup.py	2010-10-19 06:40:00 UTC (rev 117738)
+++ z3c.schemadiff/trunk/setup.py	2010-10-19 06:46:10 UTC (rev 117739)
@@ -46,6 +46,10 @@
                         'zope.component',
                         'zope.pagetemplate',
                         ],
+      extras_require=dict(
+          test=[
+              'zope.component [test]',
+              ]),
       include_package_data = True,
       zip_safe = False,
       )

Modified: z3c.schemadiff/trunk/src/z3c/schemadiff/tests.py
===================================================================
--- z3c.schemadiff/trunk/src/z3c/schemadiff/tests.py	2010-10-19 06:40:00 UTC (rev 117738)
+++ z3c.schemadiff/trunk/src/z3c/schemadiff/tests.py	2010-10-19 06:46:10 UTC (rev 117739)
@@ -1,29 +1,22 @@
-from zope import interface
 from zope import component
+from zope import interface
 from zope import schema
+import doctest
+import zope.component.testing
 
-import zope.testing
-import unittest
 
-OPTIONFLAGS = (zope.testing.doctest.REPORT_ONLY_FIRST_FAILURE |
-               zope.testing.doctest.ELLIPSIS |
-               zope.testing.doctest.NORMALIZE_WHITESPACE)
+OPTIONFLAGS = (doctest.REPORT_ONLY_FIRST_FAILURE |
+               doctest.ELLIPSIS |
+               doctest.NORMALIZE_WHITESPACE)
 
-import zope.component.testing
 
 def test_suite():
-    doctests = ('README.txt',)
-
     globs = dict(interface=interface, component=component, schema=schema)
-    
-    return unittest.TestSuite((
-        zope.testing.doctest.DocFileSuite(doctest,
-                                          optionflags=OPTIONFLAGS,
-                                          setUp=zope.component.testing.setUp,
-                                          tearDown=zope.component.testing.tearDown,
-                                          globs=globs,
-                                          package="z3c.schemadiff") for doctest in doctests
-        ))
 
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')
+    return doctest.DocFileSuite(
+        'README.txt',
+        optionflags=OPTIONFLAGS,
+        setUp=zope.component.testing.setUp,
+        tearDown=zope.component.testing.tearDown,
+        globs=globs,
+        package="z3c.schemadiff")



More information about the checkins mailing list