Skip to content

Commit 71a8e9a

Browse files
committed
fix pytest collect hook
1 parent 97f2255 commit 71a8e9a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/conftest.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ def pytest_make_collect_report(collector):
6565
https://github.com/duckdblabs/duckdb-internal/issues/6182
6666
"""
6767
outcome = yield
68-
result = outcome.get_result()
68+
report: pytest.CollectReport = outcome.get_result()
6969

7070
if sys.version_info[:2] == (3, 14):
7171
# Only handle failures from module collectors
72-
if result.failed and collector.__class__.__name__ == "Module":
73-
longrepr = str(result.longrepr)
74-
if "ModuleNotFoundError: No module named 'pyarrow'" in longrepr:
75-
result.outcome = "skipped"
76-
result.longrepr = f"XFAIL: pyarrow not available {collector.name} ({longrepr.strip()})"
72+
if report.failed and collector.__class__.__name__ == "Module":
73+
longreprtext = report.longreprtext
74+
if "ModuleNotFoundError: No module named 'pyarrow'" in longreprtext:
75+
report.outcome = "skipped"
76+
reason = f"XFAIL: [pyarrow not available] {longreprtext}"
77+
report.longrepr = (report.fspath, None, reason)
7778

7879

7980
# https://docs.pytest.org/en/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option

0 commit comments

Comments
 (0)