2828from numpy .testing import (
2929 assert_allclose , assert_array_equal , assert_array_almost_equal )
3030from matplotlib import rc_context
31- from matplotlib .cbook import (
32- IgnoredKeywordWarning , MatplotlibDeprecationWarning )
31+ from matplotlib .cbook import MatplotlibDeprecationWarning
3332
3433# Note: Some test cases are run twice: once normally and once with labeled data
3534# These two must be defined in the same test function or need to have
@@ -3679,7 +3678,7 @@ def test_eventplot_colors(colors):
36793678
36803679
36813680@image_comparison (['test_eventplot_problem_kwargs.png' ], remove_text = True )
3682- def test_eventplot_problem_kwargs ():
3681+ def test_eventplot_problem_kwargs (recwarn ):
36833682 '''
36843683 test that 'singular' versions of LineCollection props raise an
36853684 IgnoredKeywordWarning rather than overriding the 'plural' versions (e.g.
@@ -3694,19 +3693,18 @@ def test_eventplot_problem_kwargs():
36943693 fig = plt .figure ()
36953694 axobj = fig .add_subplot (111 )
36963695
3697- with warnings .catch_warnings (record = True ) as w :
3698- warnings .simplefilter ("always" )
3699- axobj .eventplot (data ,
3700- colors = ['r' , 'b' ],
3701- color = ['c' , 'm' ],
3702- linewidths = [2 , 1 ],
3703- linewidth = [1 , 2 ],
3704- linestyles = ['solid' , 'dashed' ],
3705- linestyle = ['dashdot' , 'dotted' ])
3706-
3707- # check that three IgnoredKeywordWarnings were raised
3708- assert len (w ) == 3
3709- assert all (issubclass (wi .category , IgnoredKeywordWarning ) for wi in w )
3696+ axobj .eventplot (data ,
3697+ colors = ['r' , 'b' ],
3698+ color = ['c' , 'm' ],
3699+ linewidths = [2 , 1 ],
3700+ linewidth = [1 , 2 ],
3701+ linestyles = ['solid' , 'dashed' ],
3702+ linestyle = ['dashdot' , 'dotted' ])
3703+
3704+ # check that three IgnoredKeywordWarnings were raised
3705+ assert len (recwarn ) == 3
3706+ assert all (issubclass (wi .category , MatplotlibDeprecationWarning )
3707+ for wi in recwarn )
37103708
37113709
37123710def test_empty_eventplot ():
0 commit comments