@@ -405,10 +405,10 @@ def test_warn_mixed_args_and_kwargs(self):
405405 th = np .linspace (0 , 2 * np .pi , 1024 )
406406 lns , = ax .plot (th , np .sin (th ), label = 'sin' )
407407 lnc , = ax .plot (th , np .cos (th ), label = 'cos' )
408- with pytest .warns (UserWarning ) as record :
408+ with pytest .warns (DeprecationWarning ) as record :
409409 ax .legend ((lnc , lns ), labels = ('a' , 'b' ))
410410 assert len (record ) == 1
411- assert str (record [0 ].message ) == (
411+ assert str (record [0 ].message ). startswith (
412412 "You have mixed positional and keyword arguments, some input may "
413413 "be discarded." )
414414
@@ -474,10 +474,10 @@ def test_warn_args_kwargs(self):
474474 fig , axs = plt .subplots (1 , 2 )
475475 lines = axs [0 ].plot (range (10 ))
476476 lines2 = axs [1 ].plot (np .arange (10 ) * 2. )
477- with pytest .warns (UserWarning ) as record :
477+ with pytest .warns (DeprecationWarning ) as record :
478478 fig .legend ((lines , lines2 ), labels = ('a' , 'b' ))
479479 assert len (record ) == 1
480- assert str (record [0 ].message ) == (
480+ assert str (record [0 ].message ). startswith (
481481 "You have mixed positional and keyword arguments, some input may "
482482 "be discarded." )
483483
0 commit comments