Re: [Zope-dev] Circular dependency hell.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lennart Regebro wrote:
On Fri, Apr 16, 2010 at 19:35, Tres Seaver <tseaver@palladion.com> wrote:
== Suggestion 1 ==
I think we should deprecate zope.testing. Completely. There has been some discussion about deprecating it for something else, but I think we should just deprecate it. Just say "Don't use zope.testing, it's pure evil". We can recommend another testrunner, and it seems nose is winning the wars in the Python world there, but I don't think we necessarily need to do that. Most testrunners will find the tests by themselves, and the tests should be runnable with any testrunner, so which one you use is a minor issue. I'm +0 on this myself. Certainly I don't think that we should have packages hard-wire dependencies on zope.testing in order to run their own tests.
Instead the big problem with getting rid of zope.testing is that many tests use other specific features like the doctest renormalizers etc. These could possibly be extracted into separate modules so you can use them with other testrunners. Maybe instead we should strip zope.testing down so that it includes only these bits (the ones that get imported by third-party test code), and move the testrunner out to a separate package, e.g. 'zope.testrunner'. I think Marius Gedminas already suggested such a thing: we could update zc.recipe.testrunner to use the new package, which would make existing buildouts continue to wok.
That would be an improvement at least. Maybe we can determine what is actually in zope.testing and see what can be split out.
I know of three parts:
1. The testrunner.
Right: moving it out would clarify.
2. The special doctest
Already deprecated in favor of the stdlib module. and a module called doctestunit, of unclear use. It is already deprecated, contains nothing but BBB imports and a funky wrapper or ppprint.pprint (the way the wrapper is constructed is pretty insane). Unfortunately, it is widely used in ZTK tests, mostly in ways which should be replace with the stdlib doctest module. The ``pprint`` function could be moved into a new module, perhaps.
3. The doctest renormalizers. 4. Anything else?
:mod:`zope.testing.exceptions` used only by the custom doctest and the testrunner. It could just move to the testrunner. :mod:`zope.testing.formparser` Parses rendered HTML forms back to datastructures. Maybe useful in tests which consume rendered output. No ZTK tests use this module. :mod:`zope.testing.loggingsupport` Enable assertions about how code uses Python's logging module. No ZTK tests use this module. Tests in :mod:`zc.buildout`, :mod:`zope.app.appsetup`, :mod:`ZODB`, and :mod:`zc.lockfile` use this module. :mod:`zope.testing.loghandler` *Another* module enabling assertions about how code uses Python's logging module. No ZTK tests use this module. :mod:`zope.testing.module` Support for jamming a dummy module into sys.modules, and getting it out again in a testcase's tearDown.. Tests in :mod:`zope.copy` and :mod:`zope.container` use this module. Tests in :mod:`ZODB` also use this module :mod:`zope.testing.server` Runs an HTTP server (?!) in the middle of a functional test, and uses the stdlib 'webbrowser' module to make a request. No ZTK tests use this module. :mod:`zope.testing.setupstack` Support for chaining together teardown functions in a stack No ZTK tests use this module. Tests in :mod:`ZODB` and :mod:`zc.lockfile` use this module.
I think the doctest renormalizers can be used with standard doctest, so it might be feasible to extract those as well?
How about we move out the testrunner (including updating zc.recipe.testrunner), clean out any remaining cruft, and release a new major version containing only bits used in real-world tests? 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 iEYEARECAAYFAkvIrw4ACgkQ+gerLs4ltQ4NCgCfaDGjIy3+dJs0EfkNEC47GdcI ITIAoNmNVBE1GBF12nzi6JAKOpdxxE52 =ZlJ4 -----END PGP SIGNATURE-----
On Fri, Apr 16, 2010 at 20:40, Tres Seaver <tseaver@palladion.com> wrote:
How about we move out the testrunner (including updating zc.recipe.testrunner), clean out any remaining cruft, and release a new major version containing only bits used in real-world tests?
Sounds like a good plan to me. -- Lennart Regebro: Python, Zope, Plone, Grok http://regebro.wordpress.com/ +33 661 58 14 64
On Fri, Apr 16, 2010 at 20:43, Lennart Regebro <regebro@gmail.com> wrote:
On Fri, Apr 16, 2010 at 20:40, Tres Seaver <tseaver@palladion.com> wrote:
How about we move out the testrunner (including updating zc.recipe.testrunner), clean out any remaining cruft, and release a new major version containing only bits used in real-world tests?
Sounds like a good plan to me.
The renormalizers are used by the testrunner tests, so I think they possibly also needs separating, unless we make zope.tesrunner depend on zope.testing, but then I'm not sure if we gained much. :) -- Lennart Regebro: Python, Zope, Plone, Grok http://regebro.wordpress.com/ +33 661 58 14 64
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lennart Regebro wrote:
On Fri, Apr 16, 2010 at 20:43, Lennart Regebro <regebro@gmail.com> wrote:
On Fri, Apr 16, 2010 at 20:40, Tres Seaver <tseaver@palladion.com> wrote:
How about we move out the testrunner (including updating zc.recipe.testrunner), clean out any remaining cruft, and release a new major version containing only bits used in real-world tests? Sounds like a good plan to me.
The renormalizers are used by the testrunner tests, so I think they possibly also needs separating, unless we make zope.tesrunner depend on zope.testing, but then I'm not sure if we gained much. :)
We will have factored the "reusable" bits (which we know get re-used) into a smaller, cleaner package, which should (I hope) be easier to port. Other packages which depend on only those bits should be more easily testable without the testrunner, and therefore easier to port as well. 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 iEYEARECAAYFAkvIzCIACgkQ+gerLs4ltQ5URQCbBN5C5yBBejUXADc9RZA8NAcA 6/wAnAwdLSjvuFXoI97r+qOTuAO7rxe/ =Alpv -----END PGP SIGNATURE-----
On Fri, Apr 16, 2010 at 22:44, Tres Seaver <tseaver@palladion.com> wrote:
We will have factored the "reusable" bits (which we know get re-used) into a smaller, cleaner package, which should (I hope) be easier to port.
Other packages which depend on only those bits should be more easily testable without the testrunner, and therefore easier to port as well.
Yeah, could work. I'm looking at separating the testrunner now. And the testrunner tests use the renormalizer (which is clean and portable) and the loggingsupport (which I haven't looked at yet). -- Lennart Regebro: Python, Zope, Plone, Grok http://regebro.wordpress.com/ +33 661 58 14 64
On Fri, Apr 16, 2010 at 2:40 PM, Tres Seaver <tseaver@palladion.com> wrote:
:mod:`zope.testing.formparser` Parses rendered HTML forms back to datastructures. Maybe useful in tests which consume rendered output.
No ZTK tests use this module.
I believe this may be used in tests of some of the zope.app.* packages; I don't recall which ones. This predates zope.testbrowser; users should consider migrating to that.
:mod:`zope.testing.loggingsupport` Enable assertions about how code uses Python's logging module.
No ZTK tests use this module.
Tests in :mod:`zc.buildout`, :mod:`zope.app.appsetup`, :mod:`ZODB`, and :mod:`zc.lockfile` use this module.
Many application tests use this module.
:mod:`zope.testing.module` Support for jamming a dummy module into sys.modules, and getting it out again in a testcase's tearDown..
Tests in :mod:`zope.copy` and :mod:`zope.container` use this module.
Tests in :mod:`ZODB` also use this module
Many application tests use this module.
:mod:`zope.testing.setupstack` Support for chaining together teardown functions in a stack
No ZTK tests use this module.
Tests in :mod:`ZODB` and :mod:`zc.lockfile` use this module.
Many application tests use this as well. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "Chaos is the score upon which reality is written." --Henry Miller
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Fred Drake wrote:
On Fri, Apr 16, 2010 at 2:40 PM, Tres Seaver <tseaver@palladion.com> wrote:
:mod:`zope.testing.formparser` Parses rendered HTML forms back to datastructures. Maybe useful in tests which consume rendered output.
No ZTK tests use this module.
I believe this may be used in tests of some of the zope.app.* packages; I don't recall which ones.
This predates zope.testbrowser; users should consider migrating to that.
:mod:`zope.testing.loggingsupport` Enable assertions about how code uses Python's logging module.
No ZTK tests use this module.
Tests in :mod:`zc.buildout`, :mod:`zope.app.appsetup`, :mod:`ZODB`, and :mod:`zc.lockfile` use this module.
Many application tests use this module.
:mod:`zope.testing.module` Support for jamming a dummy module into sys.modules, and getting it out again in a testcase's tearDown..
Tests in :mod:`zope.copy` and :mod:`zope.container` use this module.
Tests in :mod:`ZODB` also use this module
Many application tests use this module.
:mod:`zope.testing.setupstack` Support for chaining together teardown functions in a stack
No ZTK tests use this module.
Tests in :mod:`ZODB` and :mod:`zc.lockfile` use this module.
Many application tests use this as well.
Good to know, thanks. 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 iEYEARECAAYFAkvIyCAACgkQ+gerLs4ltQ5vigCffNKHLdcQdXFQMFmgrxfoELXF 6cEAn0s2V2KiO33nwCA1FNFRaNUnXThp =f0Gm -----END PGP SIGNATURE-----
participants (3)
-
Fred Drake -
Lennart Regebro -
Tres Seaver