Skip to content

Commit ab17a00

Browse files
author
Philipp Loose
committed
Change _issue_warning_captured stacklevel to 2 in config.PytestPluginManager
The import_plugin method should be the origin of the warning not the deeper warning from the warnings module.
1 parent 032efb6 commit ab17a00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytest/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def import_plugin(self, modname, consider_entry_points=False):
585585
_issue_warning_captured(
586586
PytestConfigWarning("skipped plugin {!r}: {}".format(modname, e.msg)),
587587
self.hook,
588-
stacklevel=1,
588+
stacklevel=2,
589589
)
590590
else:
591591
mod = sys.modules[importspec]

0 commit comments

Comments
 (0)