shortened thanks to lazy evaluation

This commit is contained in:
Martin Diehl 2021-09-02 14:35:16 +02:00
parent 727cc9da12
commit 0653d0c481
1 changed files with 2 additions and 6 deletions

View File

@ -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)