python-ballpark icon indicating copy to clipboard operation
python-ballpark copied to clipboard

place tests outside the package

Open johnyf opened this issue 7 years ago • 2 comments

The tests are located within the module ballpark.tests. It is a common convention to place tests outside the package, usually in a directory tests. They can still be distributed with the package, by adding a file MANIFEST.in.

johnyf avatar Jun 04 '17 23:06 johnyf

We can also leave them where they are, but exclude them from the setup.py, e.g:

setup(
    ...
    packages=find_packages(exclude=['tests*', 'tests.*', '*.tests']),
)

Either way, we should avoid importing them: https://github.com/debrouwere/python-ballpark/blob/0b871cdf5b4b5f50e5f3f3d044558801783381c4/ballpark/init.py#L1

asfaltboy avatar May 25 '20 12:05 asfaltboy

It seems to me that tests would better be included in the file MANIFEST.in, so that they be included in the source distribution , and thus be available on PyPI. I agree to not import tests within the package itself.

johnyf avatar Mar 09 '21 19:03 johnyf