[Checkins] SVN: zope.monkeypatches.doctest/trunk/ Tests for the third bug.

Lennart Regebro regebro at gmail.com
Fri Apr 30 10:30:22 EDT 2010


Log message for revision 111632:
  Tests for the third bug.
  

Changed:
  U   zope.monkeypatches.doctest/trunk/setup.py
  U   zope.monkeypatches.doctest/trunk/zope/monkeypatches/doctest/README.txt

-=-
Modified: zope.monkeypatches.doctest/trunk/setup.py
===================================================================
--- zope.monkeypatches.doctest/trunk/setup.py	2010-04-30 14:18:02 UTC (rev 111631)
+++ zope.monkeypatches.doctest/trunk/setup.py	2010-04-30 14:30:22 UTC (rev 111632)
@@ -6,11 +6,19 @@
 setup(name='zope.monkeypatches.doctest',
       version=version,
       description="Bugfixes for various bugs in the doctest module.",
-      long_description=open("README.txt").read() + "\n" +
+      long_description=open(os.path.join("zope","monkeypatches", "doctest", "README.txt")).read() + "\n" +
                        open(os.path.join("docs", "HISTORY.txt")).read(),
       # Get more strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
-      classifiers=[
-        "Programming Language :: Python",
+    classifiers=[
+        "Development Status :: 4 - Beta",
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: Zope Public License",
+        "Operating System :: OS Independent",
+        "Programming Language :: Python :: 2.5",
+        "Programming Language :: Python :: 2.6",
+        "Programming Language :: Python :: 2.7",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        "Topic :: Software Development :: Testing",
         ],
       keywords='doctest',
       author='Zope Foundation and Contributors',

Modified: zope.monkeypatches.doctest/trunk/zope/monkeypatches/doctest/README.txt
===================================================================
--- zope.monkeypatches.doctest/trunk/zope/monkeypatches/doctest/README.txt	2010-04-30 14:18:02 UTC (rev 111631)
+++ zope.monkeypatches.doctest/trunk/zope/monkeypatches/doctest/README.txt	2010-04-30 14:30:22 UTC (rev 111632)
@@ -35,7 +35,7 @@
 ------------------------------
 
 Due to the way releases are made on different platforms, we sometimes test
-files on a *nix system with Windows file endings. Unfortunately, that leaves
+files on a Unix system with Windows file endings. Unfortunately, that leaves
 some of the test files broken:
 
   >>> import tempfile
@@ -71,4 +71,44 @@
 but the test is set up to have a report flag of some sort, like a REPORT_NDIFF,
 the REPORT_ONLY_FIRST_FAILURE will be ignored. That's silly, so we patch that.
 
-XXX/TODO: Write tests for it.
+  >>> code = '''def fn():
+  ...     """This should fail:
+  ...     >>> assert 1 == 2
+  ...     True
+  ...
+  ...     >>> assert 2 == 1
+  ...     True
+  ...     """
+  ...     return None'''
+  >>> import imp
+  >>> newmodule = imp.new_module('newmodule')
+  >>> exec(code, newmodule.__dict__)
+  >>> suite = doctest.DocTestSuite(newmodule, optionflags=doctest.REPORT_NDIFF)
+  >>> doctest.set_unittest_reportflags(doctest.REPORT_ONLY_FIRST_FAILURE)
+  0
+  >>> runner = doctest.DocTestRunner()
+  >>> for case in suite: #doctest: +ELLIPSIS
+  ...   case.runTest()
+  Traceback (most recent call last):
+  ...
+      compileflags, 1) in test.globs
+    File "<doctest README.txt[25]>", line 2, in ...
+      case.runTest()
+  ...
+      raise self.failureException(self.format_failure(new.getvalue()))
+  AssertionError: Failed doctest test for newmodule.fn
+    File "newmodule", line 1, in fn
+  <BLANKLINE>
+  ----------------------------------------------------------------------
+  File "newmodule", line 3, in newmodule.fn
+  Failed example:
+      assert 1 == 2
+  Exception raised:
+      Traceback (most recent call last):
+  ...
+          compileflags, 1) in test.globs
+        File "<doctest newmodule.fn[0]>", line 1, in ...
+          assert 1 == 2
+      AssertionError
+  <BLANKLINE>
+  
\ No newline at end of file



More information about the checkins mailing list