[Checkins] SVN: manuel/trunk/ merge in the bug fix from branches/chrism-codeblocks

Benji York benji at zope.com
Tue Jan 5 12:58:18 EST 2010


Log message for revision 107715:
  merge in the bug fix from branches/chrism-codeblocks
  (with doctest based test instead of unittest tests)
  

Changed:
  U   manuel/trunk/CHANGES.txt
  U   manuel/trunk/setup.py
  U   manuel/trunk/src/manuel/bugs.txt
  U   manuel/trunk/src/manuel/testing.py
  U   manuel/trunk/src/manuel/tests.py

-=-
Modified: manuel/trunk/CHANGES.txt
===================================================================
--- manuel/trunk/CHANGES.txt	2010-01-05 17:29:11 UTC (rev 107714)
+++ manuel/trunk/CHANGES.txt	2010-01-05 17:58:17 UTC (rev 107715)
@@ -1,10 +1,11 @@
 CHANGES
 =======
 
-Unreleased
-----------
+1.0.3 (2010-01-05)
+------------------
 
 - fix a small doc thinko
+- fix the code-block hanlder to allow :linenos:
 
 
 1.0.2 (2009-12-07)

Modified: manuel/trunk/setup.py
===================================================================
--- manuel/trunk/setup.py	2010-01-05 17:29:11 UTC (rev 107714)
+++ manuel/trunk/setup.py	2010-01-05 17:58:17 UTC (rev 107715)
@@ -17,8 +17,7 @@
     author='Benji York',
     author_email='benji at benjiyork.com',
     description=
-        'Manuel lets you mix and match traditional doctests with custom test '
-        'syntax.',
+        'Manuel lets you build tested documentation.'
     license='ZPL',
     install_requires=[
         'setuptools',

Modified: manuel/trunk/src/manuel/bugs.txt
===================================================================
--- manuel/trunk/src/manuel/bugs.txt	2010-01-05 17:29:11 UTC (rev 107714)
+++ manuel/trunk/src/manuel/bugs.txt	2010-01-05 17:58:17 UTC (rev 107715)
@@ -91,3 +91,11 @@
     Got:
         4
     <BLANKLINE>
+
+
+Universal Newlines
+------------------
+
+Manuel should open documents with universal newlines mode enabled.
+
+    >>> suite = manuel.testing.TestSuite(m, path_to_test)

Modified: manuel/trunk/src/manuel/testing.py
===================================================================
--- manuel/trunk/src/manuel/testing.py	2010-01-05 17:29:11 UTC (rev 107714)
+++ manuel/trunk/src/manuel/testing.py	2010-01-05 17:58:17 UTC (rev 107715)
@@ -145,7 +145,8 @@
                 zope.testing.doctest._module_relative_path(
                     calling_module, path))
 
-        document = manuel.Document(open(abs_path).read(), location=abs_path)
+        document = manuel.Document(
+            open(abs_path, 'U').read(), location=abs_path)
         document.parse_with(m)
 
         for regions in group_regions_by_test_case(document):

Modified: manuel/trunk/src/manuel/tests.py
===================================================================
--- manuel/trunk/src/manuel/tests.py	2010-01-05 17:29:11 UTC (rev 107714)
+++ manuel/trunk/src/manuel/tests.py	2010-01-05 17:58:17 UTC (rev 107715)
@@ -10,21 +10,10 @@
 import re
 import unittest
 
-#doctest = manuel.absolute_import('doctest')
-from zope.testing import doctest
+doctest = manuel.absolute_import('doctest')
 
+here = os.path.dirname(os.path.abspath(__file__))
 
-def get_abs_path(p):
-    def fake():
-        pass
-    # this contorted dance is neccesitated by me wanting to be able to run the
-    # tests with "bin/py src/manuel/tests.py" since bin/py uses execfile, which
-    # means that __file__ -- which I'd normally use here -- will be "bin/py"
-    # not the path to *this* module
-    here = os.path.dirname(fake.func_code.co_filename)
-    return os.path.join(os.getcwd(), here, p)
-
-
 def test_suite():
     optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
     checker = renormalizing.RENormalizing([
@@ -38,7 +27,8 @@
     m += manuel.doctest.Manuel(optionflags=optionflags, checker=checker)
     m += manuel.codeblock.Manuel()
     m += manuel.capture.Manuel()
-    return manuel.testing.TestSuite(m, *tests)
+    return manuel.testing.TestSuite(m, *tests,
+        globs={'path_to_test': os.path.join(here, 'bugs.txt')})
 
 
 if __name__ == '__main__':



More information about the checkins mailing list