Request: Add notes about where to put unit tests
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- Half a day
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation, testing-qa
Research direction
No target file or test is named. Start by reviewing the linked pytest good-practices and packaging discussions, then locate the relevant testing documentation; done means explaining test-file placement, import/PYTHONPATH considerations, and the role of init.py in Python 3.
Written by the indexing model from the issue text.
Description
I did some Googling. None of the pages have very good explanations of where to put your unit test files.
Also, AFAIK (I am a Python newbiew) there are some drawbacks to <project_root>/test/ about importing. Might need to modify PYTHONPATH during unit test runs.
Also, please talk about why init.py is important for unit tests. A few places recommend it... but I thought it was dead in Python3.
Ref: http://pytest.org/latest/goodpractises.html
Ref: http://stackoverflow.com/questions/5341006/where-should-i-put-tests-when-packaging-python-modules
Ref: http://stackoverflow.com/questions/61151/where-do-the-python-unit-tests-go
- Dominant language
- Batchfile
- Stars
- 29.8k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from realpython/python-guide
-
Page 404 error Open
Difficulty 1/5 Under an hour Newbie friendliness 65/100
realpython/python-guide#1104 · 2 comments ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
realpython/python-guide#327 ·
-
PyZMQ improvements Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
realpython/python-guide#326 · 5 comments ·
-
@alex Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
realpython/python-guide#1194 ·
-
Development Team SAP Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
realpython/python-guide#1192 ·
All issues in realpython/python-guide
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
palladius/rails8-app-on-gcp#145 ·
-
NeedsTriage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
error Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
textual definition
Difficulty 1/5 Under an hour Newbie friendliness 90/100
geneontology/go-ontology#32653 ·