Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the tests directory outside of the code directory #6526

Closed
ricardoV94 opened this issue Feb 16, 2023 Discussed in #6172 · 1 comment · Fixed by #6540
Closed

Move the tests directory outside of the code directory #6526

ricardoV94 opened this issue Feb 16, 2023 Discussed in #6172 · 1 comment · Fixed by #6540

Comments

@ricardoV94
Copy link
Member

Discussed in #6172

Originally posted by Armavica October 2, 2022
Hi,
With the reorganization of the tests complete (#5777), a last question remains: where to place the tests directory. It currently resides inside the pymc code directory:

pymc/
├── benchmarks/
├── docs/
├── pymc/
│   ├── __init__.py
│   ├── model.py
│   ├── ...
│   └── tests/
└── scripts/

but one could argue that it would make more sense to put it at the same level as benchmarks/, docs/ and pymc/:

pymc/
├── benchmarks/
├── docs/
├── pymc/
│   ├── __init__.py
│   ├── model.py
│   └── ...
├── scripts/
└── tests/

This is what is recommended by the official Python packaging guide, by the Pytest good practices guide, the Poetry package management tool as well as by other guides.
However, I have to note that numpy, scipy, and pandas all have tests inside the code directory.

Besides the arguments advanced by the Pytest good practices guide, I can add that I often grep the source code directory to see where or how a function or class is used or defined. With the tests directory where it is currently, a lot of noise is often returned from the tests.

Cost of the transition: probably limited to some imports to change in the test files to reflect the move.

What is your opinion on this?

@ricardoV94
Copy link
Member Author

ricardoV94 commented Feb 16, 2023

@Armavica do you want to work on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant