aports/community/py3-matplotlib/test.patch
2023-04-29 10:15:55 +02:00

154 lines
5.0 KiB
Diff

diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
index 9cadbd7..1b6cdfb 100644
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -5057,6 +5057,9 @@ def test_specgram_origin_kwarg():
plt.specgram(signal, origin='lower')
+@pytest.mark.x86
+@pytest.mark.armv7
+@pytest.mark.armhf
@image_comparison(
["psd_freqs.png", "csd_freqs.png", "psd_noise.png", "csd_noise.png"],
remove_text=True, tol=0.002)
diff --git a/lib/matplotlib/tests/test_figure.py b/lib/matplotlib/tests/test_figure.py
index 48b4a88..aa9e637 100644
--- a/lib/matplotlib/tests/test_figure.py
+++ b/lib/matplotlib/tests/test_figure.py
@@ -1328,6 +1328,7 @@ def test_add_axes_kwargs():
plt.close()
+@pytest.mark.x86
def test_ginput(recwarn): # recwarn undoes warn filters at exit.
warnings.filterwarnings("ignore", "cannot show the figure")
fig, ax = plt.subplots()
diff --git a/lib/matplotlib/tests/test_font_manager.py b/lib/matplotlib/tests/test_font_manager.py
index 2a34122..3011cb0 100644
--- a/lib/matplotlib/tests/test_font_manager.py
+++ b/lib/matplotlib/tests/test_font_manager.py
@@ -305,6 +305,7 @@ def test_fontentry_dataclass_invalid_path():
@pytest.mark.skipif(sys.platform == 'win32', reason='Linux or OS only')
+@pytest.mark.skip(reason='Fails on builders')
def test_get_font_names():
paths_mpl = [cbook._get_data_path('fonts', subdir) for subdir in ['ttf']]
fonts_mpl = findSystemFonts(paths_mpl, fontext='ttf')
diff --git a/lib/matplotlib/tests/test_polar.py b/lib/matplotlib/tests/test_polar.py
index 942ffcb..a29a2bd 100644
--- a/lib/matplotlib/tests/test_polar.py
+++ b/lib/matplotlib/tests/test_polar.py
@@ -415,6 +415,7 @@ def test_axvline_axvspan_do_not_modify_rlims():
assert ax.get_ylim() == (0, .2)
+@pytest.mark.x86
def test_cursor_precision():
ax = plt.subplot(projection="polar")
# Higher radii correspond to higher theta-precisions.
diff --git a/pytest.ini b/pytest.ini
index f4a8057..5b3cff1 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -10,3 +10,11 @@ minversion = 3.6
testpaths = lib
python_files = test_*.py
junit_family = xunit2
+markers =
+ nonfunctional
+ x86_64
+ x86
+ ppc64le
+ s390x
+ armhf
+ armv7
--- ./lib/matplotlib/tests/test_triangulation.py.orig
+++ ./lib/matplotlib/tests/test_triangulation.py
@@ -882,6 +882,7 @@
plt.tricontour(tri_refi, z_test_refi, levels=levels, colors="black")
+@pytest.mark.x86_64
@image_comparison(['tri_smooth_gradient.png'], remove_text=True, tol=0.092)
def test_tri_smooth_gradient():
# Image comparison based on example trigradient_demo.
--- ./lib/matplotlib/tests/test_legend.py.orig
+++ ./lib/matplotlib/tests/test_legend.py
@@ -486,6 +486,7 @@
"be discarded.")
+@pytest.mark.nonfunctional
def test_figure_legend_outside():
todos = ['upper ' + pos for pos in ['left', 'center', 'right']]
todos += ['lower ' + pos for pos in ['left', 'center', 'right']]
--- ./lib/matplotlib/tests/test_constrainedlayout.py.orig
+++ ./lib/matplotlib/tests/test_constrainedlayout.py
@@ -626,7 +626,8 @@
assert ppos.x0 > 0.2
assert ppos.y0 > 0.2
-
+# test seems to be flaky, not sure if it's architecture dependent
+@pytest.mark.nonfunctional
def test_compressed1():
fig, axs = plt.subplots(3, 2, layout='compressed',
sharex=True, sharey=True)
--- ./lib/matplotlib/tests/test_image.py.orig
+++ ./lib/matplotlib/tests/test_image.py
@@ -893,6 +893,8 @@
ax2.imshow(Z.astype('>f8'), **kwargs)
+@pytest.mark.x86
+@pytest.mark.ppc64le
@image_comparison(['imshow_masked_interpolation'],
tol=0 if platform.machine() == 'x86_64' else 0.01,
remove_text=True, style='mpl20')
--- ./lib/matplotlib/tests/test_colorbar.py.orig
+++ ./lib/matplotlib/tests/test_colorbar.py
@@ -235,6 +235,7 @@
assert ax.get_anchor() == 'E'
+@pytest.mark.x86
@image_comparison(
['contour_colorbar.png'], remove_text=True,
tol=0.01 if platform.machine() in ('aarch64', 'ppc64le', 's390x') else 0)
--- ./lib/matplotlib/tests/test_widgets.py.orig
+++ ./lib/matplotlib/tests/test_widgets.py
@@ -1066,6 +1066,7 @@
check_props={'color': ['red', 'green', 'blue']})
+@pytest.mark.x86
@check_figures_equal(extensions=["png"])
def test_radio_buttons(fig_test, fig_ref):
widgets.RadioButtons(fig_test.subplots(), ["tea", "coffee"])
@@ -1111,6 +1112,7 @@
cb.activecolor = 'green'
+@pytest.mark.x86
@check_figures_equal(extensions=["png"])
def test_check_buttons(fig_test, fig_ref):
widgets.CheckButtons(fig_test.subplots(), ["tea", "coffee"], [True, True])
@@ -1244,6 +1246,7 @@
assert slider.val == 5.5
+@pytest.mark.x86
def test_slider_horizontal_vertical():
fig, ax = plt.subplots()
slider = widgets.Slider(ax=ax, label='', valmin=0, valmax=24,
@@ -1317,6 +1320,7 @@
assert_allclose(handle_positions(slider), (0.1, 0.34))
+@pytest.mark.x86
@pytest.mark.parametrize("orientation", ["horizontal", "vertical"])
def test_range_slider_same_init_values(orientation):
if orientation == "vertical":