Re: [Zope-dev] [Checkins] SVN: zope.testing/trunk/ - Open doctest files in universal mode, so that packages released in Windoes
testrunner-coverage.txt is failing since this check in. What's up with this? Jim On Aug 27, 2008, at 3:41 AM, Stephan Richter wrote:
Log message for revision 90401: - Open doctest files in universal mode, so that packages released in Windoes can be tested in Linux, for example.
- Fixed failing test in testrunner-coverage.txt. --This line, and those below, will be ignored--
AM src/zope/testing/doctest.txt M src/zope/testing/tests.py M src/zope/testing/doctest.py M src/zope/testing/testrunner/testrunner-coverage.txt M README.txt
Changed: U zope.testing/trunk/README.txt U zope.testing/trunk/src/zope/testing/doctest.py A zope.testing/trunk/src/zope/testing/doctest.txt U zope.testing/trunk/src/zope/testing/testrunner/testrunner- coverage.txt U zope.testing/trunk/src/zope/testing/tests.py
-=- Modified: zope.testing/trunk/README.txt =================================================================== --- zope.testing/trunk/README.txt 2008-08-27 07:27:11 UTC (rev 90400) +++ zope.testing/trunk/README.txt 2008-08-27 07:41:00 UTC (rev 90401) @@ -63,6 +63,8 @@
- Fixed NameError in StartUpFailure.
+- Open doctest files in universal mode, so that packages released in Windoes + can be tested in Linux, for example.
3.6.0 (2008/07/10)
Modified: zope.testing/trunk/src/zope/testing/doctest.py =================================================================== --- zope.testing/trunk/src/zope/testing/doctest.py 2008-08-27 07:27:11 UTC (rev 90400) +++ zope.testing/trunk/src/zope/testing/doctest.py 2008-08-27 07:41:00 UTC (rev 90401) @@ -2074,7 +2074,7 @@ runner = DocTestRunner(verbose=verbose, optionflags=optionflags)
# Read the file, convert it to a test, and run it. - s = open(filename).read() + s = open(filename, 'U').read() if encoding is None: encoding = pep263_encoding(s) if encoding is not None: @@ -2517,7 +2517,7 @@
# Find the file and read it. name = os.path.basename(path) - doc = open(path).read() + doc = open(path, 'U').read()
# If an encoding is specified, use it to convert the file to unicode if encoding is None:
Added: zope.testing/trunk/src/zope/testing/doctest.txt =================================================================== --- zope.testing/trunk/src/zope/testing/ doctest.txt (rev 0) +++ zope.testing/trunk/src/zope/testing/doctest.txt 2008-08-27 07:41:00 UTC (rev 90401) @@ -0,0 +1,32 @@ +======================== +Additional doctest Tests +======================== + +Most `doctest` module tests are located within the module. This file only +tests a few additional features not covered by the module tests, so that the +changes to the `doctest` module -- which is forked from the Python stanadrd +library -- are minimized. + +Working with Carriage Returns +----------------------------- + +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 +some the tests broken: + + >>> import tempfile + >>> fn = tempfile.mktemp() + >>> open(fn, 'w').write('Test:\r\n\r\n >>> x = 1 + 1\r\n\r\nDone. \r\n') + +Let's now run it as a doctest: + + >>> from zope.testing import doctest + >>> doctest.testfile(fn, False) + (0, 1) + +It worked. Let's also try the test file suite: + + >>> import unittest + >>> result = unittest.TestResult() + >>> doctest.DocFileSuite(fn, module_relative=False).run(result) + <unittest.TestResult run=1 errors=0 failures=0>
Property changes on: zope.testing/trunk/src/zope/testing/doctest.txt ___________________________________________________________________ Name: svn:eol-style + native
Modified: zope.testing/trunk/src/zope/testing/testrunner/testrunner- coverage.txt =================================================================== --- zope.testing/trunk/src/zope/testing/testrunner/testrunner- coverage.txt 2008-08-27 07:27:11 UTC (rev 90400) +++ zope.testing/trunk/src/zope/testing/testrunner/testrunner- coverage.txt 2008-08-27 07:41:00 UTC (rev 90401) @@ -52,32 +52,41 @@ Tearing down left over layers: Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds. lines cov% module (path) - 82 78% sample1.sample11.sampletests (testrunner-ex \sample1\sample11\sampletests.py) - 52 92% sample1.sample13.sampletests (testrunner-ex \sample1\sample13\sampletests.py) - 52 92% sample1.sampletests.test1 (testrunner-ex \sample1\sampletests\test1.py) - 78 94% sample1.sampletests.test11 (testrunner-ex \sample1\sampletests\test11.py) - 78 94% sample1.sampletests.test111 (testrunner-ex \sample1\sampletests\test111.py) - 78 94% sample1.sampletests.test112 (testrunner-ex \sample1\sampletests\test112.py) - 78 94% sample1.sampletests.test12 (testrunner-ex \sample1\sampletests\test12.py) - 78 94% sample1.sampletests.test121 (testrunner-ex \sample1\sampletests\test121.py) - 78 94% sample1.sampletests.test122 (testrunner-ex \sample1\sampletests\test122.py) - 52 92% sample1.sampletests.test_one (testrunner-ex \sample1\sampletests\test_one.py) - 52 92% sample1.sampletestsf (testrunner-ex \sample1\sampletestsf.py) - 52 92% sample2.sample21.sampletests (testrunner-ex \sample2\sample21\sampletests.py) - 52 92% sample2.sampletests.test_1 (testrunner-ex \sample2\sampletests\test_1.py) - 52 92% sample2.sampletests.testone (testrunner-ex \sample2\sampletests\testone.py) - 52 92% sample3.sampletests (testrunner-ex \sample3\sampletests.py) - 96 75% samplelayers (testrunner-ex\samplelayers.py) - 52 92% sampletests.test1 (testrunner-ex\sampletests \test1.py) - 78 94% sampletests.test11 (testrunner-ex\sampletests \test11.py) - 78 94% sampletests.test111 (testrunner-ex\sampletests \test111.py) - 80 95% sampletests.test112 (testrunner-ex\sampletests \test112.py) - 78 94% sampletests.test12 (testrunner-ex\sampletests \test12.py) - 78 94% sampletests.test121 (testrunner-ex\sampletests \test121.py) - 78 94% sampletests.test122 (testrunner-ex\sampletests \test122.py) - 52 92% sampletests.test_one (testrunner-ex\sampletests \test_one.py) - 122 87% sampletestsf (testrunner-ex\sampletestsf.py) - Total: 405 tests, 0 failures, 0 errors in 1.641 seconds. + 1 100% sample1.__init__ (testrunner-ex/sample1/ __init__.py) + 1 100% sample1.sample11.__init__ (testrunner-ex/ sample1/sample11/__init__.py) + 74 86% sample1.sample11.sampletests (testrunner-ex/ sample1/sample11/sampletests.py) + 1 100% sample1.sample13.__init__ (testrunner-ex/ sample1/sample13/__init__.py) + 48 100% sample1.sample13.sampletests (testrunner-ex/ sample1/sample13/sampletests.py) + 1 100% sample1.sampletests.__init__ (testrunner-ex/ sample1/sampletests/__init__.py) + 48 100% sample1.sampletests.test1 (testrunner-ex/ sample1/sampletests/test1.py) + 74 100% sample1.sampletests.test11 (testrunner-ex/ sample1/sampletests/test11.py) + 74 100% sample1.sampletests.test111 (testrunner-ex/ sample1/sampletests/test111.py) + 74 100% sample1.sampletests.test112 (testrunner-ex/ sample1/sampletests/test112.py) + 74 100% sample1.sampletests.test12 (testrunner-ex/ sample1/sampletests/test12.py) + 74 100% sample1.sampletests.test121 (testrunner-ex/ sample1/sampletests/test121.py) + 74 100% sample1.sampletests.test122 (testrunner-ex/ sample1/sampletests/test122.py) + 48 100% sample1.sampletests.test_one (testrunner-ex/ sample1/sampletests/test_one.py) + 48 100% sample1.sampletestsf (testrunner-ex/sample1/ sampletestsf.py) + 1 100% sample2.__init__ (testrunner-ex/sample2/ __init__.py) + 1 100% sample2.sample21.__init__ (testrunner-ex/ sample2/sample21/__init__.py) + 48 100% sample2.sample21.sampletests (testrunner-ex/ sample2/sample21/sampletests.py) + 1 100% sample2.sampletests.__init__ (testrunner-ex/ sample2/sampletests/__init__.py) + 48 100% sample2.sampletests.test_1 (testrunner-ex/ sample2/sampletests/test_1.py) + 48 100% sample2.sampletests.testone (testrunner-ex/ sample2/sampletests/testone.py) + 1 100% sample3.__init__ (testrunner-ex/sample3/ __init__.py) + 48 100% sample3.sampletests (testrunner-ex/sample3/ sampletests.py) + 84 85% samplelayers (testrunner-ex/samplelayers.py) + 1 100% sampletests.__init__ (testrunner-ex/ sampletests/__init__.py) + 48 100% sampletests.test1 (testrunner-ex/sampletests/ test1.py) + 74 100% sampletests.test11 (testrunner-ex/sampletests/ test11.py) + 74 100% sampletests.test111 (testrunner-ex/sampletests/ test111.py) + 76 100% sampletests.test112 (testrunner-ex/sampletests/ test112.py) + 74 100% sampletests.test12 (testrunner-ex/sampletests/ test12.py) + 74 100% sampletests.test121 (testrunner-ex/sampletests/ test121.py) + 74 100% sampletests.test122 (testrunner-ex/sampletests/ test122.py) + 48 100% sampletests.test_one (testrunner-ex/ sampletests/test_one.py) + 112 95% sampletestsf (testrunner-ex/sampletestsf.py) + Total: 405 tests, 0 failures, 0 errors in 0.630 seconds. False
The directory specified with the --coverage option will have been created and
Modified: zope.testing/trunk/src/zope/testing/tests.py =================================================================== --- zope.testing/trunk/src/zope/testing/tests.py 2008-08-27 07:27:11 UTC (rev 90400) +++ zope.testing/trunk/src/zope/testing/tests.py 2008-08-27 07:41:00 UTC (rev 90401) @@ -23,10 +23,11 @@
def test_suite(): return unittest.TestSuite(( + doctest.DocTestSuite('zope.testing.loggingsupport'), doctest.DocTestSuite('zope.testing.renormalizing'), + doctest.DocTestSuite('zope.testing.server'), + doctest.DocFileSuite('doctest.txt'), doctest.DocFileSuite('formparser.txt'), - doctest.DocTestSuite('zope.testing.loggingsupport'), - doctest.DocTestSuite('zope.testing.server'), + doctest.DocFileSuite('module.txt'), doctest.DocFileSuite('setupstack.txt'), - doctest.DocFileSuite('module.txt'), ))
_______________________________________________ Checkins mailing list Checkins@zope.org http://mail.zope.org/mailman/listinfo/checkins
-- Jim Fulton Zope Corporation
On Friday 17 October 2008, Jim Fulton wrote:
testrunner-coverage.txt is failing since this check in. What's up with this?
It passes for me on Python 2.5. Can you be more specific? Are you using a ZC-internal set of package versions? :-) Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. "Zope Stephan Richter"
On Oct 17, 2008, at 3:16 PM, Stephan Richter wrote:
On Friday 17 October 2008, Jim Fulton wrote:
testrunner-coverage.txt is failing since this check in. What's up with this?
It passes for me on Python 2.5.
Sigh. It passes for me too with 2.5.
Can you be more specific?
It fails with Python 2.4. I guess we should live with this. :( I don't feel like chasing it and I'm sure you don't either. Never mind. Jim -- Jim Fulton Zope Corporation
participants (2)
-
Jim Fulton -
Stephan Richter