Am 25.06.2010 16:19, schrieb holger krekel:
> 
> It internally needs to perform a collection on the ROOTDIR 
> in order to "select" 'a'.  In fact, the reason behind all this is that
> py.test tries to construct a *canonical* collection tree up to the command
> line specified argument and this three starts from the ROOTDIR / root node 
> which is indeed determined as the last non-init-containing directory. 
> 
>> I hope I could make my concern clearer now.
> 
> I think so - your analysis is right - i guess i didn't succeed yet in
> explaining the logic/reasoning behind the current behaviour, hope it's
> clearer now. 

Ok. Thanks so far for taking the time and explaining this.

Nevertheless i'm not absolutely happy with the situation that all
directories of the "first non-init-containing directory" (should be
called first, right?) are considered for conftest-loading.
Because without changing anything to one's project 'a' it can make a
difference in the sense of tests passing or failing for the project 'a'
in dependency of what other project folders one puts side-by-side to 'a'.
One not too unlikely side effect could be: the pytest_configure function
of each conftest.py (the one of folder 'a' and of 'b') sets something to
sys.path with a commonly used statement like "sys.path.insert(*0*,
...)". When testing project 'a' and with the fact that the order of the
conftest-loadings is that "b"'s will be loaded after "a"'s, the
sys.path.insertion of 'b' will take precedence. Regardless of the fact
the the project 'b' might have have nothing to do with project 'a', it
just sits side-by-side in the filesystem. And i'm actually not
complaining th order. For my expectaion "b"'s conftest should not be
loaded at all if i'm testing 'a' and the containing directory of 'a' and
'b' does not contain an __init__.py.

...do you agree with that :) ?

Thanks again, Best regards,
Frank


> 
> best,
> holger

_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to