From 0653d0c481f25e77f0195f7610f5c39ecb95d838 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 2 Sep 2021 14:35:16 +0200 Subject: [PATCH] shortened thanks to lazy evaluation --- python/tests/test_Result.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index b7911a1df..4f779857f 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -18,11 +18,6 @@ from damask import tensor from damask import mechanics from damask import grid_filters -def vtk_hasXdmfReader(): - if hasattr(vtk,'vtkXdmfReader'): - r = vtk.vtkXdmfReader() - if hasattr(r,'getOutput'): return True - return False @pytest.fixture def default(tmp_path,ref_path): @@ -432,7 +427,8 @@ class TestResult: assert sorted(open(tmp_path/fname).read()) == sorted(open(ref_path/fname).read()) # XML is not ordered - @pytest.mark.skipif(not vtk_hasXdmfReader(),reason='https://discourse.vtk.org/t/2450') + @pytest.mark.skipif(not (hasattr(vtk,'vtkXdmfReader') and hasattr(vtk.vtkXdmfReader(),'GetOutput')), + reason='https://discourse.vtk.org/t/2450') def test_XDMF_shape(self,tmp_path,single_phase): os.chdir(tmp_path)