From d43196d0c44efe95812f012b4483fc5266c1fd70 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:04:59 +0100 Subject: [PATCH] fix: all test --- tests/test_post.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/test_post.py b/tests/test_post.py index 06c20418ec..fd1b1d45a7 100644 --- a/tests/test_post.py +++ b/tests/test_post.py @@ -637,21 +637,23 @@ def test_elem_disp(mapdl, static_solve, comp): mapdl.set(1, 1, mute=True) mapdl.allsel() - if comp == "all": - context = pytest.raises( - ValueError, match='"ALL" not allowed in this context' - ) - else: - context = NullContext() + disp_from_grpc = mapdl.post_processing.element_displacement(comp) - with context: - disp_from_grpc = mapdl.post_processing.element_displacement(comp) - - # use pretab to get the data - table_name = "values" + # use pretab to get the data + table_name = "values" + if comp != "all": mapdl.etable(table_name, "U", comp, mute=True) arr = np.genfromtxt(mapdl.pretab(table_name).splitlines()[1:])[:, 1] - assert np.allclose(arr, disp_from_grpc) + else: + arr = [] + for direction in ["x", "y", "z"]: + mapdl.etable(table_name, "U", direction, mute=True) + arr.append( + np.genfromtxt(mapdl.pretab(table_name).splitlines()[1:])[:, 1] + ) + arr = np.array(arr).T + + assert np.allclose(arr, disp_from_grpc) @staticmethod @pytest.mark.parametrize("option", ["min", "max", "avg"])