zope.security has hidden dependency on zope.testing

Bug #119670 reported by Christian Theune
2
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Undecided
Unassigned
zope.security
Fix Released
Medium
Unassigned

Bug Description

As stated in the summary, we have a hidden dependency of the actual code of zope.security for cleanup hooks for zope.testing. I changed the code to not fail when zope.testing is not installed (zope.testing is not and IMHO should not be a dependency of zope.security):

try:
    from zope.testing.cleanup import addCleanUp
except ImportError:
    def addCleanUp(arg):
        pass

addCleanUp(_clear)

However, I think that this code should move into a different module that is test-specific.

Revision history for this message
Jim Fulton (jim-zope) wrote : Re: [Bug 119670] zope.security has hidden dependency on zope.testing

I disagree. "Test what you fly and fly what you test" suggests to me
that if tested code depends on the testing infrastructure, then the
testing infrastructure should be around at run time. The cost of
doing so is minimal.

Jim

On Jun 10, 2007, at 6:02 AM, Christian Theune wrote:

> Public bug reported:
>
> As stated in the summary, we have a hidden dependency of the actual
> code
> of zope.security for cleanup hooks for zope.testing. I changed the
> code
> to not fail when zope.testing is not installed (zope.testing is not
> and
> IMHO should not be a dependency of zope.security):
>
> try:
> from zope.testing.cleanup import addCleanUp
> except ImportError:
> def addCleanUp(arg):
> pass
>
> addCleanUp(_clear)
>
> However, I think that this code should move into a different module
> that
> is test-specific.
>
> ** Affects: zope3 (upstream)
> Importance: Undecided
> Status: Unconfirmed
>
> --
> zope.security has hidden dependency on zope.testing
> https://bugs.launchpad.net/bugs/119670
> You received this bug notification because you are a member of Zope 3
> Developers, which is the bug contact for Zope 3.

--
Jim Fulton mailto:<email address hidden> Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org

Revision history for this message
Benji York (benji) wrote :

Jim Fulton wrote:
> I disagree. "Test what you fly and fly what you test" suggests to me
> that if tested code depends on the testing infrastructure, then the
> testing infrastructure should be around at run time.

If interplanetary probes can leave their testing code in place, I think
we can too
(http://research.microsoft.com/~mbj/Mars_Pathfinder/Authoritative_Account.html).
--
Benji York
Senior Software Engineer
Zope Corporation

Revision history for this message
Christian Theune (ctheune) wrote : Re: [Bug 119670] zope.security has hidden dependency on zope.testing

Humm.

Although I do agree on the intend of the phrase "test what you fly / fly
what you test" I don't think we are loading our whole test environments
in production, are we?

And I think the addCleanup shouldn't have been there in the first place.
The NASA mission didn't say they were running their unit tests while
flying. ;)

Am Sonntag, den 10.06.2007, 18:03 +0000 schrieb Benji York:
> If interplanetary probes can leave their testing code in place, I think
> we can too
> (http://research.microsoft.com/~mbj/Mars_Pathfinder/Authoritative_Account.html).

--
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - <email address hidden> - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development

Revision history for this message
Philipp von Weitershausen (philikon) wrote :

On 10 Jun 2007, at 20:54 , Christian Theune wrote:
> Although I do agree on the intend of the phrase "test what you
> fly / fly
> what you test" I don't think we are loading our whole test
> environments
> in production, are we?

No, and that's not the point. The addCleanUp is totally harmless in
production code. It's only effective for test runs. So let's just
keep it in the code.

You write in the code:

> # XXX This code is used to support automated testing. However, it
> shouldn't be
> # here and needs to be refactored. The empty addCleanUp-method is a
> temporary
> # workaround to fix packages that depend on zope.security but don't
> have a
> # need for zope.testing.

Why can't this code be there? Why is so bad to depend on
zope.testing, even if you don't have a need for it? Just install it,
disk space is cheap. It's not going to be any more or less harmful, I
think that's what Benji is talking about.

Revision history for this message
Benji York (benji) wrote :

Philipp von Weitershausen wrote:
> Why can't this code be there? Why is so bad to depend on
> zope.testing, even if you don't have a need for it? Just install it,
> disk space is cheap. It's not going to be any more or less harmful, I
> think that's what Benji is talking about.

My thoughts exactly.
--
Benji York
Senior Software Engineer
Zope Corporation

Tres Seaver (tseaver)
Changed in zope3:
status: New → Won't Fix
Revision history for this message
Tres Seaver (tseaver) wrote :

tlotze added a 'tests' extra dependency in r116625,
to be released with 3.8.0.

Changed in zope.security:
importance: Undecided → Medium
status: New → Fix Committed
Tres Seaver (tseaver)
Changed in zope.security:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.