[TIP] PyTest test directory structure confusion

Tony Cappellini cappy2112 at gmail.com
Thu Aug 29 14:56:22 PDT 2019

Message: 2
Date: Wed, 28 Aug 2019 14:48:21 +0300
From: Marius Gedminas <marius at gedmin.as>
Subject: Re: [TIP] PyTest test directory structure confusion
To: testing-in-python at lists.idyll.org
Message-ID: <20190828114821.zo5dt4bmjxgcs6ss at blynas>
Content-Type: text/plain; charset="utf-8"

Thanks Marius

>>You have the simplest possible case: one code file, one test file.  You
>>don't need a directory structure at this point, just the two files:

>>    mycode.py
>>    tests.py

Even though I'm just now getting my head around testing with Pytest,
I've decided to put the tests in a separate directory called unit_tests,
which is at the same level as the directory containing the file being

I don't have any __init__.py in the test directory.

I don't know if my setup is optimal yet, but I'm able to run the tests I've
written and got reasonable results. Getting tests written and able to run
is a significant first step, even though there are still many questions in
my head.
The main thing is that I'm testing- finally.

Thanks- all
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20190829/e0a225e4/attachment.htm>

More information about the testing-in-python mailing list