<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Yes, the directories test and test/module all contain a __init__.py;
sorry, that I didnt mention this important info.<br>
<br>
So from your question I guess that you expect py.test to find and
execute conftest.py in all the cases shown?<br>
<br>
<br>
Jens<br>
<br>
<br>
<div class="moz-cite-prefix">On 09/25/2014 01:09 PM, Anatoly
Bubenkov wrote:<br>
</div>
<blockquote
cite="mid:CACTnz+HZP4Tox0kJz1DKNt3G+SsoZ2vfkGzu452C9jxnRAP9Xw@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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 moz-do-not-send="true"
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 MyTestClassContainedInTestFooDotPy<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>
_______________________________________________<br>
Pytest-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:Pytest-dev@python.org" target="_blank">Pytest-dev@python.org</a><br>
<a moz-do-not-send="true"
href="https://mail.python.org/mailman/listinfo/pytest-dev"
target="_blank">https://mail.python.org/mailman/listinfo/pytest-dev</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">Anatoly Bubenkov<br>
</div>
</div>
</blockquote>
<br>
<div class="moz-signature">-- <br>
Jens Hoffmann
Softwareentwickler Datamanagement billiger.de solute gmbh
Zeppelinstraße 15
D-76185 Karlsruhe Tel: +49 (0)721 - 86956-24
Fax: +49 (0)721 - 86956-66
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:rsc@solute.de">rsc@solute.de</a>
Web: <a class="moz-txt-link-freetext" href="http://www.billiger.de">http://www.billiger.de</a>
Geschäftsführer: Lorenz Petersen Sitz: Karlsruhe
Registergericht: Amtsgericht Mannheim
Registernummer: HRB 110579
Umsatzsteueridentifikationsnummer: DE234663798
<a class="moz-txt-link-freetext" href="http://cdn.billiger.com/static/mail/billiger_today_logo_dunkel_20140911.png">http://cdn.billiger.com/static/mail/billiger_today_logo_dunkel_20140911.png</a></div>
</body>
</html>