Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
holoviz
GitHub Repository: holoviz/panel
Path: blob/main/examples/conftest.py
3218 views
1
from importlib.util import find_spec
2
3
collect_ignore_glob = [
4
"apps/",
5
"developer_guide/",
6
"homepage.ipynb",
7
"*VTK*.ipynb",
8
"*Vega.ipynb",
9
"*DeckGL*.ipynb",
10
"*Terminal.ipynb",
11
]
12
13
if find_spec("altair") is None:
14
collect_ignore_glob += [
15
"gallery/altair_brushing.ipynb",
16
"gallery/gapminders.ipynb",
17
"gallery/penguin_kmeans.ipynb",
18
"reference/panes/Streamz.ipynb",
19
]
20
21
if find_spec("streamz") is None:
22
collect_ignore_glob += [
23
"reference/panes/DataFrame.ipynb",
24
"reference/panes/Streamz.ipynb",
25
]
26
27
if find_spec("datashader") is None:
28
collect_ignore_glob += [
29
"gallery/glaciers.ipynb",
30
"gallery/windturbines.ipynb",
31
"gallery/vtk_slicer.ipynb",
32
]
33
34
if find_spec("pyvista") is None:
35
collect_ignore_glob += [
36
"gallery/vtk_interactive.ipynb",
37
"gallery/vtk_warp.ipynb",
38
]
39
40
41
def pytest_runtest_makereport(item, call):
42
"""
43
Skip tests that fail because "the kernel died before replying to kernel_info"
44
this is a common error when running the example tests in CI.
45
46
Inspired from: https://stackoverflow.com/questions/32451811
47
48
"""
49
from _pytest.runner import pytest_runtest_makereport
50
51
tr = pytest_runtest_makereport(item, call)
52
53
if call.excinfo is not None:
54
msgs = [
55
"Kernel died before replying to kernel_info",
56
"Kernel didn't respond in 60 seconds",
57
]
58
for msg in msgs:
59
if call.excinfo.type == RuntimeError and call.excinfo.value.args[0] in msg:
60
tr.outcome = "skipped"
61
tr.wasxfail = f"reason: {msg}"
62
63
return tr
64
65