Hi people. I just removed zope.testing from the zope.index dependency and replaced zope.testing.doctest imports with plain python doctest and it seems to work with python 2.4 and 2.5 here. Now, it only depends on ZODB3 and zope.interface, which is nice :) Is there any objections on this? If no, can someone make a release on PyPI of this package? -- WBR, Dan Korostelev
On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote:
I just removed zope.testing from the zope.index dependency and replaced zope.testing.doctest imports with plain python doctest and it seems to work with python 2.4 and 2.5 here. Now, it only depends on ZODB3 and zope.interface, which is nice :) Is there any objections on this?
Yes. Using 'import doctest' rather than 'from zope.testing import doctest' was a pretty reliable way to break test.py --coverage, at least on Python 2.4. Please use try: # needed for reliable unit test coverage measurement from zope.testing import doctest except ImportError: import doctest instead.
If no, can someone make a release on PyPI of this package?
Marius Gedminas -- ... there is always a well-known solution to every human problem -- neat, plausible, and wrong. -- H. L. Mencken (1880-1956), "Prejudices"
2008/12/2 Marius Gedminas <marius@gedmin.as>:
On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote:
I just removed zope.testing from the zope.index dependency and replaced zope.testing.doctest imports with plain python doctest and it seems to work with python 2.4 and 2.5 here. Now, it only depends on ZODB3 and zope.interface, which is nice :) Is there any objections on this?
Yes.
Using 'import doctest' rather than 'from zope.testing import doctest' was a pretty reliable way to break test.py --coverage, at least on Python 2.4.
Oh, thanks for the hint. I'll fix that now. :) There's no need to use try/except though, it's nicer just to create an extras_require for tests, I think. -- WBR, Dan Korostelev
On Tue, Dec 2, 2008 at 6:48 AM, Dan Korostelev <nadako@gmail.com> wrote:
2008/12/2 Marius Gedminas <marius@gedmin.as>:
On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote:
I just removed zope.testing from the zope.index dependency and replaced zope.testing.doctest imports with plain python doctest and it seems to work with python 2.4 and 2.5 here. Now, it only depends on ZODB3 and zope.interface, which is nice :) Is there any objections on this?
Yes.
Using 'import doctest' rather than 'from zope.testing import doctest' was a pretty reliable way to break test.py --coverage, at least on Python 2.4.
Oh, thanks for the hint. I'll fix that now. :) There's no need to use try/except though, it's nicer just to create an extras_require for tests, I think.
The status quo is to forgo creating extras unless there is a compelling reason to have one. Creating a test extra just to remove a dependency on zope.testing -- which only depends on zope.interface -- is not compelling. -- Benji York Senior Software Engineer Zope Corporation
"Benji York" <benji@zope.com> writes:
On Tue, Dec 2, 2008 at 6:48 AM, Dan Korostelev <nadako@gmail.com> wrote:
2008/12/2 Marius Gedminas <marius@gedmin.as>:
On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote:
I just removed zope.testing from the zope.index dependency and replaced zope.testing.doctest imports with plain python doctest and it seems to work with python 2.4 and 2.5 here. Now, it only depends on ZODB3 and zope.interface, which is nice :) Is there any objections on this?
Yes.
Using 'import doctest' rather than 'from zope.testing import doctest' was a pretty reliable way to break test.py --coverage, at least on Python 2.4.
Oh, thanks for the hint. I'll fix that now. :) There's no need to use try/except though, it's nicer just to create an extras_require for tests, I think.
The status quo is to forgo creating extras unless there is a compelling reason to have one. Creating a test extra just to remove a dependency on zope.testing -- which only depends on zope.interface -- is not compelling.
I'd be curious, for my own edification, to hear what would be compelling reasons. Thanks! Ross
Previously Marius Gedminas wrote:
On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote:
I just removed zope.testing from the zope.index dependency and replaced zope.testing.doctest imports with plain python doctest and it seems to work with python 2.4 and 2.5 here. Now, it only depends on ZODB3 and zope.interface, which is nice :) Is there any objections on this?
Yes.
Using 'import doctest' rather than 'from zope.testing import doctest' was a pretty reliable way to break test.py --coverage, at least on Python 2.4.
Isn't that a bug in test.py that should be fixed then? Wichert. -- Wichert Akkerman <wichert@wiggy.net> It is simple to make things. http://www.wiggy.net/ It is hard to make things simple.
On Tue, Dec 02, 2008 at 10:03:01PM +0100, Wichert Akkerman wrote:
Previously Marius Gedminas wrote:
On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote:
I just removed zope.testing from the zope.index dependency and replaced zope.testing.doctest imports with plain python doctest and it seems to work with python 2.4 and 2.5 here. Now, it only depends on ZODB3 and zope.interface, which is nice :) Is there any objections on this?
Yes.
Using 'import doctest' rather than 'from zope.testing import doctest' was a pretty reliable way to break test.py --coverage, at least on Python 2.4.
Isn't that a bug in test.py that should be fixed then?
AFAIU it's a bug in Python's doctest.py that's been fixed in Zope's copy. I believe it was fixed in a newer Python version. Unfortunately, I cannot find a reference to a bug. All I remember is that I once spent a couple of days making sure test coverage worked, and the last fix was going through the source tree and replacing 'import doctest' with 'from zope.testing import doctest'. It was a long time ago, so I could be wrong about the Python version. It may have been 2.3's doctest.py that had the bug. I just diffed Zope's doctest.py with Python 2.4 and 2.5 versions, and I don't see anything that looks like a fix for tracing. (I see other differences, though, like making sure a test's globs are preserved, and a whole new feature flag INTERPRET_FOOTNOTES.) Actually, I can look at svn logs... http://zope3.pov.lt/trac/changeset/28704 http://zope3.pov.lt/trac/changeset/28705 http://mail.zope.org/pipermail/zope3-dev/2004-December/012990.html Yes, it was a bug in Python 2.3, and that fix is present in 2.4's doctest.py. Since we don't support 2.3 any more, I retract my objection to plain 'import doctest' on the grounds of coverage. Although people should be aware of the other differences between Zope's doctest and Python's doctest (unfortunate, that). Marius Gedminas -- C, n: A programming language that is sort of like Pascal except more like assembly except that it isn't very much like either one, or anything else. It is either the best language available to the art today, or it isn't. -- Ray Simard
participants (6)
-
Benji York -
Brian Sutherland -
Dan Korostelev -
Marius Gedminas -
Ross Patterson -
Wichert Akkerman