Skip to content

Adjust the implprefix DeprecationWarning's stack level #166

Closed
@edmorley

Description

@edmorley

Hi!

In #144 a deprecation warning was added for usage of the implprefix argument.

However the warnings.warn() call doesn't set a stacklevel, which means when the warning is output, the blamed line is in pluggy, rather than the plugin that's using implprefix. For example:
https://travis-ci.org/mozilla/treeherder/jobs/409417404#L895

Passing stacklevel=2 would make it clearer as to where the issue lies, and also mean the correct module path can be referenced in eg pytest's filterwarnings (for downstream projects who enable warnings/deprecation warnings as errors).

Many thanks :-)

CC @tgoodlet

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions