Skip to content

Adjust the implprefix DeprecationWarning's stack level #166

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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