yunstanford / pytest-sanic

a Pytest Plugin for Sanic.
http://pytest-sanic.readthedocs.io/en/latest
Apache License 2.0
135 stars 21 forks source link

`tests` dir in project root gets exposed as a package #34

Closed igozali closed 4 years ago

igozali commented 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.

Details

The underlying issue is setup.py using find_packages() and realizing that tests is also a package since it has an __init__.py

Here are some possible fixes:

yunstanford commented 4 years ago

@igozali thanks for bringing this up, it should be fixed now.