Skip to content

All coverage commands should adjust sys.path #358

@nedbat

Description

@nedbat

The Django coverage plugin has an issue about not being able to find settings: coveragepy/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?


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions