Skip to content

Commit 7a15bad

Browse files
Update src/_pytest/warning_types.py
Co-authored-by: Florian Bruhin <[email protected]>
1 parent 14919c4 commit 7a15bad

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/_pytest/warning_types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,5 @@ def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None:
168168
lineno=lineno,
169169
)
170170
except Warning as w:
171+
# If warnings are errors (e.g. -Werror), location information gets lost, so we add it to the message.
171172
raise type(w)(f"{w}\n at {filename}:{lineno}") from None

0 commit comments

Comments
 (0)