Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ef97b9

Browse files
committed
Remove newline from start of deprecation warnings
This breaks the summary from Pytest when warnings are errors, as then you just get a bunch of: ``` FAILED lib/matplotlib/tests/test_getattr.py::test_getattr[matplotlib.afm] - matplotlib._api.deprecation.MatplotlibDeprecationWarning: ``` with no real context as to the problem. Also, as noted at the original PR [1], it makes setting `filterwarnings` more complicated. [1] #11224 (comment)
1 parent e49d6b6 commit 4ef97b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/_api/deprecation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def _generate_deprecation_warning(
3232
removal = f"in {removal}" if removal else "two minor releases later"
3333
if not message:
3434
message = (
35-
("\nThe %(name)s %(obj_type)s" if obj_type else "%(name)s")
35+
("The %(name)s %(obj_type)s" if obj_type else "%(name)s")
3636
+ (" will be deprecated in a future version"
3737
if pending else
3838
(" was deprecated in Matplotlib %(since)s"

0 commit comments

Comments
 (0)