8000 TST: Filter deprecation warnings for set_color_cycle. · matplotlib/matplotlib@99cdccb · GitHub
[go: up one dir, main page]

Skip to content

Commit 99cdccb

Browse files
committed
TST: Filter deprecation warnings for set_color_cycle.
This test is specifically trying to call the deprecated function to make sure it works.
1 parent d085fc3 commit 99cdccb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/tests/test_cycles.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import warnings
22

3+
from matplotlib.cbook import 8F8C MatplotlibDeprecationWarning
34
from matplotlib.testing.decorators import image_comparison, cleanup
45
import matplotlib.pyplot as plt
56
import numpy as np
@@ -184,6 +185,11 @@ def test_cycle_reset():
184185
fig, ax = plt.subplots()
185186
# Need to double-check the old set/get_color_cycle(), too
186187
with warnings.catch_warnings():
188+
warnings.filterwarnings(
189+
'ignore',
190+
'The set_color_cycle attribute was deprecated in version 1.5.',
191+
MatplotlibDeprecationWarning)
192+
187193
prop = next(ax._get_lines.prop_cycler)
188194
ax.set_color_cycle(['c', 'm', 'y', 'k'])
189195
assert prop != next(ax._get_lines.prop_cycler)

0 commit comments

Comments
 (0)
0