[pytest-dev] conftest.py ordering depends on the current directory?
ws at gocept.com
Mon Sep 15 08:21:30 CEST 2014
if you have a nested module structure with nested conftest files
that (re)define the same fixture name, my expectation is that the
definition of the "closest" conftest file is used -- and usually this
works fine (yay! :-).
For example (please see the attached tarball), if
* something/conftest.py defines fixture "one" as 1
* something/submodule/conftest.py defines fixture "one" as 2
then I think this should mean that tests in
* something and something/tests should get "1", while
* something/submodule and something/submodule/tests should get "2"
However, this seems to depend on the current working directory or
something. If the py.test binary is in another directory, say next to
the sources, then:
* "cd ..; py.test package" works, while
* "py.test ../package" does not
(You can try these with the attached tarball by going into the runner
directory and calling "make working" or "make notworking").
Can somebody tell me what's going on here? Is this intentional? Am I
Thanks for your help,
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 997 bytes
Desc: not available
More information about the Pytest-dev