[py-dev] py.test: initializing test environment

Jan Balster jan at balster.info
Fri Nov 4 18:08:29 CET 2005

Ian Bicking wrote:
> Does Directory.__init__ always get invoked?

If all subdirs are valid python packages (__init__.py exists), yes.
Otherwise Directory.__init__  gets invoked only if you specify a directory.

If you are interested in the reason, look at
py/test/collect.py:getfscollector(line 36). There is a special case: when the
specified module has no package path (returned by
py/path/local/local.py:pypkgpath(line 333)) the module is used without using the
directory collector. Perhaps that should be changed, so the "Directory" from
conftest is always used. I have to write some tests (heh, it's a testing
framework ;-)) to see if this change doesn't break something else.

Have a good weekend,

More information about the Pytest-dev mailing list