test runner should skip directories that can't possibly be packages

Bug #251759 reported by Marius Gedminas
4
Affects Status Importance Assigned to Milestone
zope.testing
Fix Released
Undecided
Christian Theune

Bug Description

Currently zope.testing.testrunner naively assumes all directories under the location specified as --test-path are Python packages. This is not always true, as Chris Withers has discovered by placing his egg cache under that location.

The test runner should ignore directories with names that are not valid Python package names (e.g. names with dots in them).

The test runner should also ignore directories with no __init__.py inside them. (I thought it already did so, but apparently not.)

Revision history for this message
Barry Warsaw (barry) wrote :

I think I'm being affected by this same bug. If I put my top-level package directory next to my setup.py file, and I let buildout put the eggs in its standard place, bin/test will fail. See this thread:

http://mail.python.org/pipermail/distutils-sig/2009-January/010757.html

Note that if I put the eggs elsewhere, or if I put my mailman directory under a src directory, then there's no problem.

Revision history for this message
ChrisW (chris-simplistix) wrote : Re: [Bug 251759] Re: test runner should skip directories that can't possibly be packages

Barry Warsaw wrote:
> I think I'm being affected by this same bug. If I put my top-level
> package directory next to my setup.py file, and I let buildout put the
> eggs in its standard place, bin/test will fail. See this thread:

Yup, that's the one.

You'll also get the same problem if you build that package into an egg
and then try and run the tests.

I currently work around this by having buildout use an egg cache
elsewhere specified in my default.cfg(C:\buildout-eggs in my case) which
has other advantages in that lots of buildouts need the same eggs, and
they only need to be downloaded once.

I work around the build problem by building eggs on one machine and
running tests on another.

 > Note that if I put the eggs elsewhere, or if I put my mailman directory
 > under a src directory, then there's no problem.

Yeah, but I hate that pattern, and it sounds like you're not fond of it
either ;-)

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk

Revision history for this message
Christian Theune (ctheune) wrote :

This was also brought up recently on the distutils list. I'll have a look.

Changed in zope.testing:
assignee: nobody → Christian Theune (ct-gocept)
status: New → In Progress
Revision history for this message
Christian Theune (ctheune) wrote :

Fixed in trunk r101495

Changed in zope.testing:
status: In Progress → Fix Committed
Changed in zope.testing:
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.