Hi Harmut, It works for me when I use your repository directly:
λ pip install pytest PyInstaller λ python -m pytest src ======================== test session starts ======================== platform win32 -- Python 3.6.8, pytest-5.3.2, py-1.8.1, pluggy-0.13.1 rootdir: C:\Users\bruno\hooksample collected 1 item src\pyi_hooksample\__pyinstaller\t\test_hooksample_packaging.py . [100%] ========================= warnings summary ========================== src/pyi_hooksample/__pyinstaller/t/test_hooksample_packaging.py::test_pyi_hooksample C:\Users\bruno\hooksample\.env36\lib\site-packages\PyInstaller\lib\modulegraph\util.py:4: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp -- Docs: https://docs.pytest.org/en/latest/warnings.html =================== 1 passed, 1 warning in 4.87s ==================== But the instructions you wrote don’t fit the repository, so I suspect you have changed the layout since writing your original email. Could you please perhaps pushing to a branch the exact state of your instructions so I can try to reproduce the issue? Thanks! Cheers, Bruno On Thu, Jan 16, 2020 at 6:25 AM Hartmut Goebel <h.goe...@crazy-compilers.com> wrote: > 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.goe...@crazy-compilers.com | > | www.crazy-compilers.com | compilers which you thought are impossible | > > > _______________________________________________ > pytest-dev mailing list > pytest-dev@python.org > https://mail.python.org/mailman/listinfo/pytest-dev >
_______________________________________________ pytest-dev mailing list pytest-dev@python.org https://mail.python.org/mailman/listinfo/pytest-dev