Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py Clean out module-scope imports.
Hi Tres! Tres Seaver wrote: yuppie wrote: Tres Seaver wrote: Log message for revision 97800: Clean out module-scope imports. [...] What was wrong with these imports? I don't like module-scope imports in unit tests: I want tests to *fail*, not be skipped, when something is not importable. I put my rationale in this blog entry: http://palladion.com/home/tseaver/obzervationz/2008/unit_testing_notes-20080724 Thanks for the pointer. I agree with the Never import the module-under-test at test module scope-rule, but I'm not convinced the Minimize module-scope dependencies guideline is important. If you don't like module-scope imports and I don't like method-scope imports we need a policy to make sure we don't work against each other. I'm fine with following your policy if you think it is important, but I think we need an official decision. Cheers, Yuppie ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests
Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py Clean out module-scope imports.
Tres Seaver wrote: Log message for revision 97800: Clean out module-scope imports. Changed: U Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py -=- Modified: Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py === --- Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py 2009-03-10 12:59:04 UTC (rev 97799) +++ Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py 2009-03-10 13:20:03 UTC (rev 97800) @@ -16,17 +16,7 @@ import unittest -import Testing -from AccessControl.SecurityManagement import getSecurityManager -from AccessControl.SecurityManagement import newSecurityManager -from DateTime import DateTime -from zope.interface.verify import verifyClass - -from Products.CMFCore.tests.base.dummy import DummyContent -from Products.CMFCore.tests.base.dummy import DummySite -from Products.CMFCore.tests.base.security import OmnipotentUser -from Products.CMFCore.tests.base.security import UserWithRoles from Products.CMFCore.tests.base.testcase import SecurityTest What was wrong with these imports? Cheers, Yuppie ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests
Re: [Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py Clean out module-scope imports.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 yuppie wrote: Tres Seaver wrote: Log message for revision 97800: Clean out module-scope imports. Changed: U Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py -=- Modified: Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py === --- Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py 2009-03-10 12:59:04 UTC (rev 97799) +++ Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py 2009-03-10 13:20:03 UTC (rev 97800) @@ -16,17 +16,7 @@ import unittest -import Testing -from AccessControl.SecurityManagement import getSecurityManager -from AccessControl.SecurityManagement import newSecurityManager -from DateTime import DateTime -from zope.interface.verify import verifyClass - -from Products.CMFCore.tests.base.dummy import DummyContent -from Products.CMFCore.tests.base.dummy import DummySite -from Products.CMFCore.tests.base.security import OmnipotentUser -from Products.CMFCore.tests.base.security import UserWithRoles from Products.CMFCore.tests.base.testcase import SecurityTest What was wrong with these imports? I don't like module-scope imports in unit tests: I want tests to *fail*, not be skipped, when something is not importable. I put my rationale in this blog entry: http://palladion.com/home/tseaver/obzervationz/2008/unit_testing_notes-20080724 Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJtrFn+gerLs4ltQ4RAhOAAKCS/QoCbex5FOE+CevM4oPS0bVU5wCgocg7 bPxq/nV3CaSX/0CFtPvsaOQ= =Wzi8 -END PGP SIGNATURE- ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests