Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

Re: SVN: Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py Clean out module-scope imports.

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


y.2009 at wcm-solutions

Mar 10, 2009, 9:03 AM

Post #1 of 3 (429 views)
Permalink
Re: 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[at]lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


tseaver at palladion

Mar 10, 2009, 11:28 AM

Post #2 of 3 (397 views)
Permalink
Re: SVN: Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py Clean out module-scope imports. [In reply to]

-----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 tseaver[at]palladion.com
Palladion Software "Excellence by Design" http://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[at]lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2009 at wcm-solutions

Mar 11, 2009, 1:11 PM

Post #3 of 3 (391 views)
Permalink
Re: SVN: Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py Clean out module-scope imports. [In reply to]

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[at]lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.