1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
|
--- a/tests/plotting/test_charts.py
+++ b/tests/plotting/test_charts.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+import importlib
import itertools
import platform
import weakref
@@ -25,6 +26,12 @@
reason=f"test HTTP requests are refused on {platform.machine()}")
+# charts fail if paraview is used to provide vtkmodules
+# since it does not provide vtkPythonContext2D
+if importlib.util.find_spec("paraview"):
+ pytestmark = pytest.mark.skip("paraview provides vtk without vtkPythonContext2D required for charts")
+
+
def vtk_array_to_tuple(arr):
return tuple(arr.GetValue(i) for i in range(arr.GetNumberOfValues()))
--- a/tests/plotting/test_plotting.py
+++ b/tests/plotting/test_plotting.py
@@ -7,6 +7,7 @@
from __future__ import annotations
import inspect
+import importlib
import io
import os
import pathlib
@@ -48,6 +49,11 @@
from pytest_mock import MockerFixture
+# charts fail if paraview is used to provide vtkmodules
+# since it does not provide vtkPythonContext2D
+xfail_charts = pytest.mark.xfail(importlib.util.find_spec("paraview"),
+ reason="paraview provides vtk without vtkPythonContext2D required for charts")
+
# skip all tests if unable to render
pytestmark = pytest.mark.skip_plotting
@@ -2791,6 +2797,7 @@
@pytest.mark.skip_mac('MacOS CI fails when downloading examples')
@pytest.mark.needs_vtk_version(9, 2, 0)
+@xfail_charts
def test_chart_plot():
"""Basic test to verify chart plots correctly"""
# Chart 1 (bottom left)
@@ -2858,6 +2865,7 @@
@skip_9_1_0
+@xfail_charts
def test_chart_matplotlib_plot(verify_image_cache):
"""Test integration with matplotlib"""
# Seeing CI failures for Conda job that need to be addressed
@@ -2890,6 +2898,7 @@
@pytest.mark.usefixtures('no_images_to_verify')
+@xfail_charts
def test_get_charts():
"""Test that the get_charts method is retuning a list of charts"""
chart = pv.Chart2D()
@@ -3655,6 +3664,7 @@
@skip_9_1_0
+@xfail_charts
def test_charts_sin():
x = np.linspace(0, 2 * np.pi, 20)
y = np.sin(x)
--- a/tests/core/test_polydata.py
+++ b/tests/core/test_polydata.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import importlib
from math import pi
import pathlib
from pathlib import Path
@@ -1245,6 +1246,8 @@
arc.extrude_rotate()
+@pytest.mark.xfail(importlib.util.find_spec("paraview"),
+ reason="paraview provides inconsistent vtk")
def test_flip_normals(sphere):
with pytest.warns(
PyVistaDeprecationWarning, match='`flip_normals` is deprecated. Use `flip_faces` instead'
--- a/tests/core/test_dataset_filters.py
+++ b/tests/core/test_dataset_filters.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import functools
+import importlib
import itertools
from pathlib import Path
import platform
@@ -34,6 +35,9 @@
if TYPE_CHECKING:
from pytest_mock import MockerFixture
+xfail_paraview = pytest.mark.xfail(importlib.util.find_spec("paraview"),
+ reason="paraview provides vtk without vtkImageDilateErode3D")
+
normals = ['x', 'y', '-z', (1, 1, 1), (3.3, 5.4, 0.8)]
# test for i386/i486/i586/i686
@@ -2918,6 +2922,7 @@
)
+@xfail_paraview
def test_image_dilate_erode_output_type():
point_data = np.zeros((10, 10, 10))
point_data[4, 4, 4] = 1
@@ -2929,6 +2934,7 @@
assert isinstance(volume_dilate_erode, pv.ImageData)
+@xfail_paraview
def test_image_dilate_erode_dilation():
point_data = np.zeros((10, 10, 10))
point_data[4, 4, 4] = 1
@@ -2945,6 +2951,7 @@
)
+@xfail_paraview
def test_image_dilate_erode_erosion():
point_data = np.zeros((10, 10, 10))
point_data[4, 4, 4] = 1
@@ -2958,6 +2965,7 @@
)
+@xfail_paraview
def test_image_dilate_erode_cell_data_specified():
point_data = np.zeros((10, 10, 10))
cell_data = np.zeros((9, 9, 9))
@@ -2968,6 +2976,7 @@
volume.image_dilate_erode(scalars='cell_data')
+@xfail_paraview
def test_image_dilate_erode_cell_data_active():
point_data = np.zeros((10, 10, 10))
cell_data = np.zeros((9, 9, 9))
--- a/tests/core/test_reader.py
+++ b/tests/core/test_reader.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import importlib
from pathlib import Path
import pickle
import platform
@@ -1076,6 +1077,8 @@
@pytest.mark.needs_vtk_version(
9, 1, 0, reason='Requires VTK>=9.1.0 for a concrete PartitionedDataSetWriter class.'
)
+@pytest.mark.xfail(importlib.util.find_spec("paraview"),
+ reason="paraview provides inconsistent vtk")
def test_xmlpartitioneddatasetreader(tmpdir):
tmpfile = tmpdir.join('temp.vtpd')
partitions = pv.PartitionedDataSet(
--- a/tests/core/test_composite.py
+++ b/tests/core/test_composite.py
@@ -1,6 +1,7 @@
from __future__ import annotations
from collections.abc import Generator
+import importlib
import itertools
import pathlib
import platform
@@ -412,6 +413,8 @@
assert multi_z_bounds == poly_z_bounds
+@pytest.mark.xfail(importlib.util.find_spec("paraview"),
+ reason="paraview provides inconsistent vtk")
def test_multi_block_eq(multiblock_all_with_nested_and_none):
multi = multiblock_all_with_nested_and_none
other = multi.copy()
--- a/tests/core/test_grid.py
+++ b/tests/core/test_grid.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import importlib
import pathlib
from pathlib import Path
import re
@@ -932,6 +933,8 @@
assert np.allclose(structured.cell_data[k], v)
+@pytest.mark.xfail(importlib.util.find_spec("paraview"),
+ reason="paraview provides inconsistent vtk")
def test_create_image_data_from_specs():
# empty
grid = pv.ImageData()
--- a/tests/core/test_utilities.py
+++ b/tests/core/test_utilities.py
@@ -4,6 +4,7 @@
from collections.abc import Iterable
import contextlib
+import importlib
import json
import os
from pathlib import Path
@@ -749,6 +750,8 @@
alg.Update()
+@pytest.mark.xfail(importlib.util.find_spec("paraview"),
+ reason="paraview provides inconsistent vtk")
def test_vtk_error_catcher():
# raise_errors: False
error_catcher = pv.core.utilities.observers.VtkErrorCatcher()
--- a/tests/plotting/test_collection.py
+++ b/tests/plotting/test_collection.py
@@ -3,9 +3,11 @@
from __future__ import annotations
import gc
+import importlib
import weakref
import numpy as np
+import pytest
import vtk
import pyvista as pv
@@ -48,6 +50,8 @@
pl.add_mesh(sphere, scalars=range(sphere.n_points))
+@pytest.mark.xfail(importlib.util.find_spec("paraview"),
+ reason="paraview provides vtk without vtkPythonContext2D required for charts")
def test_plotting_collection():
"""Ensure that we don't leak Plotter, Renderer and Charts instances."""
pl = pv.Plotter()
--- a/tests/core/test_dataobject.py
+++ b/tests/core/test_dataobject.py
@@ -1,6 +1,7 @@
from __future__ import annotations
from collections import UserDict
+import importlib
import json
import multiprocessing
import pickle
@@ -47,6 +48,8 @@
assert mesh1 != mesh3
+@pytest.mark.xfail(importlib.util.find_spec("paraview"),
+ reason="paraview provides inconsistent vtk")
def test_uniform_eq():
orig = examples.load_uniform()
copy = orig.copy(deep=True)
|