Open
Description
While reviewing #11917 I noticed a problem with the warning re-emitting code added in pytest 8.0. I think the module=w.__module__
line below is wrong:
Lines 324 to 331 in aaa9ca7
w
here is a warnings.WarningMessage
so w.__module__
is always "warnings"
. But the warning.warn_explicit
say this should rather be the module of the warning that is used for filtering.
If I'm reading the warnings
code correctly, the module
originally passed by the user is not preserved, so the warning cannot be re-emitted faithfully in this regard, but we can probably do something better than the current situation.