<div dir="ltr">did you add __init__.py in all folders?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 25 September 2014 12:35, Jens Hoffmann <span dir="ltr"><<a href="mailto:jh@solute.de" target="_blank">jh@solute.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
<br>
we are working with pytest 2.6.2 and I run into a problem with my conftest session fixture setup.<br>
<br>
My project structure looks something like this:<br>
<br>
.<br>
├── project<br>
│ └── module<br>
│ └── foo.py<br>
└── test<br>
├── conftest.py<br>
└── module<br>
└── test_foo.py<br>
<br>
<br>
conftest.py contains a single fixture with scope="session" and autouse=True, setting up some database that is needed for every single unittest. So also test_foo.py depends on that database setup.<br>
<br>
Now some py.test runs:<br>
<br>
$ py.test<br>
=> conftest.py called, database setup properly, tests pass<br>
<br>
$ py.test test/module<br>
=> tests fail, fixture in conftest.py not executed<br>
<br>
$ py.test test/module/test_foo.py<br>
=> tests fail, fixture in conftest.py not executed<br>
<br>
$ py.test -k MyTestClassContainedInTestFooD<u></u>otPy<br>
=> tests fail, fixture in conftest.py not executed<br>
<br>
<br>
Now my question/problem: Are all these outcoms expected behaviour? I hoped that all the runs would pass, that is execute my session fixture so that I wont need to always run my whole test suite.<br>
<br>
<br>
Thank you for your answer,<br>
Jens<br>
<br>
______________________________<u></u>_________________<br>
Pytest-dev mailing list<br>
<a href="mailto:Pytest-dev@python.org" target="_blank">Pytest-dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pytest-dev" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/pytest-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Anatoly Bubenkov<br></div>
</div>