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

Avoid __init__.py in tests directory #52

Closed
HolgerPeters opened this issue May 11, 2015 · 5 comments
Closed

Avoid __init__.py in tests directory #52

HolgerPeters opened this issue May 11, 2015 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@HolgerPeters
Copy link
Contributor

The pytest docs (https://pytest.org/latest/goodpractises.html) advice to not put an __init__.py file into the tests directory:

avoid “init.py” files in your test directories. This way your tests can run easily against an installed version of mypkg, independently from the installed package if it contains the tests or not.

@FlorianWilhelm FlorianWilhelm added the bug Something isn't working label May 13, 2015
@FlorianWilhelm FlorianWilhelm added this to the 2.2 milestone May 13, 2015
@FlorianWilhelm
Copy link
Member

@HolgerPeters Good point, thanks, are you up for a PR?

@HolgerPeters
Copy link
Contributor Author

yes I am, probably not this week though.

@HolgerPeters
Copy link
Contributor Author

I suggest replacing __init__.py by a conftest.py (https://pytest.org/latest/plugins.html) if the directory tests would be empty, it would not persist in git - and adding a conftest.py seems better than checking in a .dummy.txt

@FlorianWilhelm
Copy link
Member

Yes, sounds like a good plan.

@FlorianWilhelm
Copy link
Member

@HolgerPeters Your PR was merged and a dummy conftest.py file is created with a bit of information about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants