bast/somepackage

Test Directory as compared to always in module tests

texastony opened this issue · 1 comments

I do not know if it is best practice to keep tests the actual modules (.py) files as compared to separate test directory. The large package's I follow to try and do things right (Numpy, Keras, OpenCV) all keep the tests separate from the core modules. I guess its a preference matter, as I am unaware of a PEP that dictates it, but its something that anyone looking for a guide should be aware of.

bast commented

Thanks Tony! I will change/clarify that. I think pytest recommends tests in a separate directory:
https://docs.pytest.org/en/latest/goodpractices.html

I personally like to have tests close to sources to simplify refactoring and because I often use tests as documentation but I think the general practice is to isolate them into a test directory and I will implement that very soon (now traveling).