From 2dbf2dc2452c2fd1361d250c28cf4f9f811c685d Mon Sep 17 00:00:00 2001 From: German Date: Mon, 2 Oct 2023 17:31:11 +0200 Subject: [PATCH] Adding more fields to test to avoid pytest.pyvista names collision. See https://github.com/pyvista/pytest-pyvista/issues/93 --- tests/test_plotting.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tests/test_plotting.py b/tests/test_plotting.py index c6e4d20074..ab6199a04c 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -209,15 +209,16 @@ def test_bc_plot_options( @pytest.mark.parametrize( - "bc_labels", + "bc_labels", # Added second part of the argument to avoid image cache name clashing. + # See https://github.com/pyvista/pytest-pyvista/issues/93 [ - "Mechanical", - "mechanical", - "meCHANICAL", - "ux", - "UX", - ["UX", "UY"], - "CSGZ", + ["Mechanical", "Title case"], + ["mechanical", "lower case"], + ["meCHANICAL", "Mixed case"], + ["ux", "Lower case"], + ["UX", "Upper case"], + [["UX", "UY"], "List of displacements"], + ["CSGZ", "Magnetic forces"], ], ) def test_bc_plot_bc_labels(mapdl, bc_example, bc_labels): @@ -225,9 +226,9 @@ def test_bc_plot_bc_labels(mapdl, bc_example, bc_labels): return_plotter=True, plot_bc=True, plot_bc_labels=True, - bc_labels=bc_labels, + bc_labels=bc_labels[0], ) - assert isinstance(p, Plotter) + assert isinstance(p, Plotter), bc_labels[1] p.show() # plotting for catching @@ -251,8 +252,8 @@ def test_bc_plot_bc_labels_error(mapdl, bc_example, bc_labels): @pytest.mark.parametrize( "bc_target", [ - "Nodes", - "NOdes", + ["Nodes", "Title case"], + ["NOdes", "Mixed case"], ], ) def test_bc_plot_bc_target(mapdl, bc_example, bc_target): @@ -260,9 +261,9 @@ def test_bc_plot_bc_target(mapdl, bc_example, bc_target): return_plotter=True, plot_bc=True, plot_bc_labels=True, - bc_target=bc_target, + bc_target=bc_target[0], ) - assert isinstance(p, Plotter) + assert isinstance(p, Plotter), bc_target[1] p.show() # plotting for catching