[pytest-dev] pytest does not collect test-cases - what am I doing wrong?

Hartmut Goebel h.goebel at crazy-compilers.com
Thu Jan 16 04:25:15 EST 2020


Hi,

my package layout follows the "Tests as part of application code" [1]:

src/mypkg/__init__.py
src/mypkg/app.py
src/mypkg/test/__init__.py
src/mypkg/test/test_hooksample_packaging.py

where "__pyinstaller" contains the tests to be picked up.

1. When running "python3 -m pytest src/mypkg/test" NO tests will be
collected.

2. I tried moving src/mypkg/test into src/mypkg/test/xxx (one level more):

    * When running "python3 -m pytest src/mypkg/test", tests will be
picked up.

    * When running "python3 -m pytest src/mypkg/test/xxx" NO will be
picked up.

What am I going wrong here?

Just in case: The actual repo can be found at
<https://github.com/pyinstaller/hooksample/>.

[1]
http://doc.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code

-- 

Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel at crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |




More information about the pytest-dev mailing list