Closed igozali closed 4 years ago
Steps to Reproduce
Run the following bash commands:
python3 -m venv venv source venv/bin/activate pip3 install pytest-sanic python3 # Run the Python interpreter
From inside the Python interpreter, I can now import:
import tests.test_simple_fixtures import tests.test_server
Expected behavior
I shouldn't be able to import the tests from pytest-sanic since tests should be internal to the project.
pytest-sanic
Details
The underlying issue is setup.py using find_packages() and realizing that tests is also a package since it has an __init__.py
setup.py
find_packages()
__init__.py
Here are some possible fixes:
src/
@igozali thanks for bringing this up, it should be fixed now.
Steps to Reproduce
Run the following bash commands:
From inside the Python interpreter, I can now import:
Expected behavior
I shouldn't be able to import the tests from
pytest-sanic
since tests should be internal to the project.Details
The underlying issue is
setup.py
usingfind_packages()
and realizing that tests is also a package since it has an__init__.py
Here are some possible fixes:
src/
layout (link), which pytest also adopts, but involves some changes insetup.py