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

All coverage commands should adjust sys.path #358

Closed
nedbat opened this issue Feb 7, 2015 · 2 comments
Closed

All coverage commands should adjust sys.path #358

nedbat opened this issue Feb 7, 2015 · 2 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Feb 7, 2015

The Django coverage plugin has an issue about not being able to find settings: nedbat/django_coverage_plugin#3

The "coverage run" command sets sys.path[0] to be the directory containing the program being run, similar to what Python itself does. This makes it possible to import Django settings.

But "coverage report" and "coverage html" do not adjust the path. They are being run from /path/to/bin/coverage.py, so the current-directory-relative settings module can't be imported.

I think sys.path should include the current directory for those commands?


@nedbat
Copy link
Owner Author

nedbat commented Feb 7, 2015

Original comment by Jessamyn Smith (Bitbucket: jessamynsmith, GitHub: jessamynsmith)


I think this is sensible. It will definitely make developing plugins easier.

@nedbat
Copy link
Owner Author

nedbat commented Feb 13, 2015

Fixed in 20125fe8762d (bb)

@nedbat nedbat closed this as completed Feb 13, 2015
@nedbat nedbat added major bug Something isn't working labels Jun 23, 2018
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

1 participant