test that 'singular' versions of LineCollection props raise an MatplotlibDeprecationWarning rather than overriding the 'plural' versions (e.g., to prevent 'color' from overriding 'colors', see issue #4297)
(recwarn)
| 5536 | @image_comparison(['test_eventplot_problem_kwargs.png'], remove_text=True, |
| 5537 | style='_classic_test') |
| 5538 | def test_eventplot_problem_kwargs(recwarn): |
| 5539 | """ |
| 5540 | test that 'singular' versions of LineCollection props raise an |
| 5541 | MatplotlibDeprecationWarning rather than overriding the 'plural' versions |
| 5542 | (e.g., to prevent 'color' from overriding 'colors', see issue #4297) |
| 5543 | """ |
| 5544 | np.random.seed(0) |
| 5545 | |
| 5546 | data1 = np.random.random([20]).tolist() |
| 5547 | data2 = np.random.random([10]).tolist() |
| 5548 | data = [data1, data2] |
| 5549 | |
| 5550 | fig = plt.figure() |
| 5551 | axobj = fig.add_subplot() |
| 5552 | |
| 5553 | axobj.eventplot(data, |
| 5554 | colors=['r', 'b'], |
| 5555 | color=['c', 'm'], |
| 5556 | linewidths=[2, 1], |
| 5557 | linewidth=[1, 2], |
| 5558 | linestyles=['solid', 'dashed'], |
| 5559 | linestyle=['dashdot', 'dotted']) |
| 5560 | |
| 5561 | assert len(recwarn) == 3 |
| 5562 | assert all(issubclass(wi.category, mpl.MatplotlibDeprecationWarning) |
| 5563 | for wi in recwarn) |
| 5564 | |
| 5565 | |
| 5566 | def test_empty_eventplot(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…