Re: [Zope-dev] [Checkins] SVN: zope.app.testing/trunk/ Switch doctests to use the stdlib ``doctest`` module.
Hello Tres,
Log message for revision 110723: Switch doctests to use the stdlib ``doctest`` module.
o Disuse than the deprecated ``zope.testing.doctest`` variant.
Remove a duplicated import.
Changed: U zope.app.testing/trunk/CHANGES.txt U zope.app.testing/trunk/src/zope/app/testing/functional.py U zope.app.testing/trunk/src/zope/app/testing/tests.py
The problem with this is that it just breaks tests that have accented unicode characters. zope.app.testing.functional.FunctionalDocFileSuite breaks, while zope.testing.doctest.DocFileSuite works. I don't remember what was the final decision on deprecating zope.testing.doctest, but this definitely s*cks. Thoughts? -- Best regards, Adam GROSZER mailto:agroszer@gmail.com -- Quote of the day: A dear old Quaker lady, distinguished for her youthful appearance, was asked what she used to preserve her appearance. She replied sweetly, 'I use for the lips, truth; for the voice, prayer; for the eyes, pity; for the hand, charity; for the figure, uprightness;and for the heart, love. - Jerry Fleishman
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Adam GROSZER wrote:
Log message for revision 110723: Switch doctests to use the stdlib ``doctest`` module.
o Disuse than the deprecated ``zope.testing.doctest`` variant.
Remove a duplicated import.
Changed: U zope.app.testing/trunk/CHANGES.txt U zope.app.testing/trunk/src/zope/app/testing/functional.py U zope.app.testing/trunk/src/zope/app/testing/tests.py
The problem with this is that it just breaks tests that have accented unicode characters.
zope.app.testing.functional.FunctionalDocFileSuite breaks, while zope.testing.doctest.DocFileSuite works. I don't remember what was the final decision on deprecating zope.testing.doctest, but this definitely s*cks.
Thoughts?
What tests are breaking? Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkwHyl8ACgkQ+gerLs4ltQ5AAgCdGO0V7xMvY/K9CfR+d+WbM0DN NzcAn1sINi7HAG23EmvdH3gqfPnwjRAd =Avts -----END PGP SIGNATURE-----
Hello Tres, Thursday, June 3, 2010, 5:29:41 PM, you wrote: TS> -----BEGIN PGP SIGNED MESSAGE----- TS> Hash: SHA1 TS> Adam GROSZER wrote:
Log message for revision 110723: Switch doctests to use the stdlib ``doctest`` module.
o Disuse than the deprecated ``zope.testing.doctest`` variant.
Remove a duplicated import.
Changed: U zope.app.testing/trunk/CHANGES.txt U zope.app.testing/trunk/src/zope/app/testing/functional.py U zope.app.testing/trunk/src/zope/app/testing/tests.py
The problem with this is that it just breaks tests that have accented unicode characters.
zope.app.testing.functional.FunctionalDocFileSuite breaks, while zope.testing.doctest.DocFileSuite works. I don't remember what was the final decision on deprecating zope.testing.doctest, but this definitely s*cks.
Thoughts?
TS> What tests are breaking? Our apps's tests. Excerpt is: # -*- coding: UTF-8 -*- <snip>
mail = mailer.prepareEmail(u"Some subject", ... u"Some body éáÉÁ", ... u"from@me.com", ... u"to@you.com") <snip>
With the stdlib doctest prepareEmail gets u'Some body \xc3\xa9\xc3\xa1\xc3\x89\xc3\x81' Note, it's unicode() and utf-8 encoded at the same time. I guess stdlib doctest does not care about # -*- coding: UTF-8 -*- -- Best regards, Adam GROSZER mailto:agroszer@gmail.com -- Quote of the day: A physicist is an atom's way of knowing about atoms. -- George Wald
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Adam GROSZER wrote:
Hello Tres,
Thursday, June 3, 2010, 5:29:41 PM, you wrote:
TS> -----BEGIN PGP SIGNED MESSAGE----- TS> Hash: SHA1
TS> Adam GROSZER wrote:
Log message for revision 110723: Switch doctests to use the stdlib ``doctest`` module.
o Disuse than the deprecated ``zope.testing.doctest`` variant.
Remove a duplicated import.
Changed: U zope.app.testing/trunk/CHANGES.txt U zope.app.testing/trunk/src/zope/app/testing/functional.py U zope.app.testing/trunk/src/zope/app/testing/tests.py The problem with this is that it just breaks tests that have accented unicode characters.
zope.app.testing.functional.FunctionalDocFileSuite breaks, while zope.testing.doctest.DocFileSuite works. I don't remember what was the final decision on deprecating zope.testing.doctest, but this definitely s*cks.
Thoughts?
TS> What tests are breaking?
Our apps's tests. Excerpt is:
# -*- coding: UTF-8 -*- <snip>
mail = mailer.prepareEmail(u"Some subject", ... u"Some body éáÉÁ", ... u"from@me.com", ... u"to@you.com") <snip>
With the stdlib doctest prepareEmail gets u'Some body \xc3\xa9\xc3\xa1\xc3\x89\xc3\x81' Note, it's unicode() and utf-8 encoded at the same time. I guess stdlib doctest does not care about # -*- coding: UTF-8 -*-
The stdlib wants any non-ASCII encoding passed to the testsuite constructor, e.g. (this is from Lib/test/test_doctest.py in Python 2.6):: If the tests contain non-ASCII characters, we have to specify which encoding the file is encoded with. We do so by using the `encoding` parameter: >>> suite = doctest.DocFileSuite('test_doctest.txt', ... 'test_doctest2.txt', ... 'test_doctest4.txt', ... encoding='utf-8') >>> suite.run(unittest.TestResult()) Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkwIBQYACgkQ+gerLs4ltQ5CUQCffTlpUV1CAHKF0+KjQr3Bh5ri 590AnizdczOZQDVPval0w490lgfOhkUx =Ayqa -----END PGP SIGNATURE-----
Hello Tres, Thursday, June 3, 2010, 9:39:50 PM, you wrote: TS> If the tests contain non-ASCII characters, we have to specify which TS> encoding the file is encoded with. We do so by using the `encoding` TS> parameter: TS> >>> suite = doctest.DocFileSuite('test_doctest.txt', TS> ... 'test_doctest2.txt', TS> ... 'test_doctest4.txt', TS> ... encoding='utf-8') TS> >>> suite.run(unittest.TestResult()) eeeek, didn't know that. Thanks. -- Best regards, Adam GROSZER mailto:agroszer@gmail.com -- Quote of the day: Who is W. O. Baker, and why is he saying those terrible things about me?
participants (2)
-
Adam GROSZER -
Tres Seaver