Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-29 Thread Marius Gedminas
On Tue, Dec 29, 2009 at 07:38:16AM +0100, Fabio Tranchitella wrote: * 2009-12-28 13:31, Marius Gedminas wrote: I think you mean assumes doctest is imported in zope.testing's __init__.py. There's no difference between modules or packages for the import statement, witness Yes, you are

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-28 Thread Marius Gedminas
On Fri, Dec 25, 2009 at 07:49:38AM +0100, Fabio Tranchitella wrote: * 2009-12-25 07:32, Lennart Regebro wrote: On Thu, Dec 24, 2009 at 14:50, Fabio Tranchitella kob...@kobold.it wrote: I don't think we can avoid the error, and to be honest I consider the code in zope.minmax to be wrong.

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-28 Thread Fabio Tranchitella
* 2009-12-28 13:31, Marius Gedminas wrote: I think you mean assumes doctest is imported in zope.testing's __init__.py. There's no difference between modules or packages for the import statement, witness Yes, you are right; any comment on my patches though? I'd love to release a zope.testing

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-27 Thread Fabio Tranchitella
* 2009-12-25 10:23, Lennart Regebro wrote: Yes, we did. But now we try to get the deprecation warnings to show up in the correct place. And we could warn for the usage of some of the names, but in the message explain that doctest.py is deprecated. What do you think about the attached patch

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-27 Thread Lennart Regebro
On Sun, Dec 27, 2009 at 10:44, Fabio Tranchitella kob...@kobold.it wrote: * 2009-12-25 10:23, Lennart Regebro wrote: Yes, we did. But now we try to get the deprecation warnings to show up in the correct place. And we could warn for the usage of some of the names, but in the message explain

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-25 Thread Lennart Regebro
On Fri, Dec 25, 2009 at 07:49, Fabio Tranchitella kob...@kobold.it wrote: No, that's perferctly correct code and not wrong in any way. It is not wrong from a syntax point of view, but it is wrong because it assumes doctest is a sub-module and not a sub-package. I understand the difference,

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Lennart Regebro
On Thu, Dec 24, 2009 at 08:26, Fabio Tranchitella kob...@kobold.it wrote: I've tested the whole ZTK KGS using the current zope.testing's trunk and the only failing package was zope.minmax (already fixed in the trunk), because it imported zope.testing and used zope.testing.doctest, which fails

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Fabio Tranchitella
* 2009-12-24 11:40, Lennart Regebro wrote: On Thu, Dec 24, 2009 at 08:26, Fabio Tranchitella kob...@kobold.it wrote: I've tested the whole ZTK KGS using the current zope.testing's trunk and the only failing package was zope.minmax (already fixed in the trunk), because it imported

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Zvezdan Petkovic
On Dec 24, 2009, at 8:50 AM, Fabio Tranchitella wrote: I don't think we can avoid the error, and to be honest I consider the code in zope.minmax to be wrong. import zope.testing x = zope.testing.doctest.DocTestFile(... The import is wrong, it should be zope.testing.doctest, and I

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Zvezdan Petkovic
On Dec 24, 2009, at 10:13 AM, Fabio Tranchitella wrote: * 2009-12-24 15:43, Zvezdan Petkovic wrote: You did not import zope.testing.doctest, but the reference to it remains. I don't think that's a fix. You are right, I committed the right fix. I was just about to commit the same thing +

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Fabio Tranchitella
* 2009-12-24 16:20, Zvezdan Petkovic wrote: Before I release the egg on PyPI: 1. Should we release as 1.1.2 (a minor change), or 2. Does the removal of dependency on zope.testing warrants a bump to 1.2.0? I think 1.1.2 is okey, you are not changing any behaviour of

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Zvezdan Petkovic
On Dec 24, 2009, at 10:26 AM, Fabio Tranchitella wrote: * 2009-12-24 16:20, Zvezdan Petkovic wrote: Before I release the egg on PyPI: 1. Should we release as 1.1.2 (a minor change), or 2. Does the removal of dependency on zope.testing warrants a bump to 1.2.0? I

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Fred Drake
On Thu, Dec 24, 2009 at 10:52 AM, Zvezdan Petkovic zvez...@zope.com wrote: Of course, it may be worth trying if there is a critical mass of supporters. Alternately, there could be a way of extending the standard doctest to achieve this feature without pushing it into the standard library. I'm

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Jim Fulton
On Thu, Dec 24, 2009 at 10:52 AM, Zvezdan Petkovic zvez...@zope.com wrote: On Dec 24, 2009, at 10:26 AM, Fabio Tranchitella wrote: * 2009-12-24 16:20, Zvezdan Petkovic wrote: ... FWIW, I preferred zope.testing.doctest reporting of 15 tests because that's the actual number of things being

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Lennart Regebro
On Thu, Dec 24, 2009 at 14:50, Fabio Tranchitella kob...@kobold.it wrote: I don't think we can avoid the error, and to be honest I consider the code in zope.minmax to be wrong. import zope.testing x = zope.testing.doctest.DocTestFile(... The import is wrong No, that's perferctly

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-24 Thread Fabio Tranchitella
* 2009-12-25 07:32, Lennart Regebro wrote: On Thu, Dec 24, 2009 at 14:50, Fabio Tranchitella kob...@kobold.it wrote: I don't think we can avoid the error, and to be honest I consider the code in zope.minmax to be wrong. import zope.testing x = zope.testing.doctest.DocTestFile(...

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-23 Thread Marius Gedminas
On Wed, Dec 23, 2009 at 01:36:33PM +0100, Fabio Tranchitella wrote: I think we should provide a zope.testing package which does not emit deprecation warnings while running the testrunner on other packages, otherwise there is no way to really understand why the package you are working on is

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-23 Thread Fabio Tranchitella
Hello, * 2009-12-23 14:33, Marius Gedminas wrote: @@ -328,6 +327,9 @@ def format_traceback(self, exc_info): Format the traceback. v = exc_info[1] +warnings.simplefilter('ignore') +from zope.testing import doctest +warnings.filters.pop()

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-23 Thread Fabio Tranchitella
I was (finally) able to patch zope.testing to use the standard Python doctest module while still supporting zope.testing.doctest if a package is importing and using it. The tests of zope.testing are passing on Python 2.4, 2.5 and 2.6 and the output from running the tests of a package which does

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-23 Thread Lennart Regebro
Notice that replacing zope.testings use of it's own doctests module with stdlibs one is a major undertaking. I have done it as a part of the Python 3 branch, because I removed doctest.py from that branch. We could look into merging those changes without removing doctests.py, but I think we might

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-23 Thread Lennart Regebro
On Wed, Dec 23, 2009 at 22:40, Lennart Regebro rege...@gmail.com wrote: Notice that replacing zope.testings use of it's own doctests module with stdlibs one is a major undertaking. OK, I'm tired. It's only a major undertaking if you remove it completely. zope.testings tests are mostly a

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-23 Thread Fabio Tranchitella
* 2009-12-23 22:48, Lennart Regebro wrote: OK, I'm tired. It's only a major undertaking if you remove it completely. zope.testings tests are mostly a question of running tests. Those should obviously still use zope.testing.doctest, and then it's a much smaller problem. This is exactly what I

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-23 Thread Lennart Regebro
On Wed, Dec 23, 2009 at 23:04, Fabio Tranchitella kob...@kobold.it wrote: * 2009-12-23 22:48, Lennart Regebro wrote: OK, I'm tired. It's only a major undertaking if you remove it completely. zope.testings tests are mostly a question of running tests. Those should obviously still use

Re: [Zope-dev] Avoid deprecation warnings in the testrunner

2009-12-23 Thread Fabio Tranchitella
* 2009-12-24 07:12, Lennart Regebro wrote: Yeah, that's fine by me. I see you did some ugly hacks to make it work like making doctest.py into directory, but I don't have a problem with that personally. I've tested the whole ZTK KGS using the current zope.testing's trunk and the only failing