We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3565943 commit 4381df5Copy full SHA for 4381df5
examples/conftest.py
@@ -0,0 +1,23 @@
1
+def pytest_runtest_makereport(item, call):
2
+ """
3
+ Skip tests that fail because "the kernel died before replying to kernel_info"
4
+ this is a common error when running the example tests in CI.
5
+
6
+ Inspired from: https://stackoverflow.com/questions/32451811
7
8
9
+ from _pytest.runner import pytest_runtest_makereport
10
11
+ tr = pytest_runtest_makereport(item, call)
12
13
+ if call.excinfo is not None:
14
+ msgs = [
15
+ "Kernel died before replying to kernel_info",
16
+ "Kernel didn't respond in 60 seconds",
17
+ ]
18
+ for msg in msgs:
19
+ if call.excinfo.type is RuntimeError and call.excinfo.value.args[0] in msg:
20
+ tr.outcome = "skipped"
21
+ tr.wasxfail = f"reason: {msg}"
22
23
+ return tr
0 commit comments