[Zope-CMF] SVN: Products.CMFCore/trunk/Products/CMFCore/tests/test_CatalogTool.py Clean out module-scope imports.

yuppie y.2009 at wcm-solutions.de
Wed Mar 11 16:11:46 EDT 2009


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



More information about the Zope-CMF mailing list