[issue44586] unittest requires __init__.py for test discovery

ma19 report at bugs.python.org
Thu Jul 8 11:03:09 EDT 2021


New submission from ma19 <matthew.bolognani at broadcom.com>:

This is how my project is currently set up:

src:
  - main.py
  - src1.py
  - src2.py
test:
  - __init__.py
  - test_src1.py
  - test_src2.py

If I remove __init__.py from the "test" directory, the unittest discovery fails.

I thought that __init__.py was no longer required since Python 3.3. Will the test discovery be able to work without __init__.py in the future?

----------
components: Library (Lib)
messages: 397144
nosy: ma19
priority: normal
severity: normal
status: open
title: unittest requires __init__.py for test discovery
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44586>
_______________________________________


More information about the Python-bugs-list mailing list