@@ -17,24 +17,29 @@ from pathlib import Path
1717from IPython.display import HTML, Markdown, display
1818
1919from vip.gherkin import parse_feature_file
20- from vip.reporting import load_results, load_troubleshooting
20+ from vip.reporting import (
21+ feature_file_for_nodeid,
22+ load_results,
23+ load_troubleshooting,
24+ troubleshooting_path,
25+ )
2126
2227data = load_results(Path("results.json"))
23- hints = load_troubleshooting(Path("../src/vip_tests/troubleshooting.toml"))
28+ _tp = troubleshooting_path()
29+ hints = load_troubleshooting(_tp) if _tp else {}
2430
2531_feature_cache: dict[str, dict] = {}
2632
2733
2834def _get_feature(nodeid: str) -> dict | None:
29- py_file = nodeid.split("::")[0] if "::" in nodeid else nodeid
30- feature_file = py_file.rsplit(".", 1)[0] + ".feature"
31- if feature_file not in _feature_cache:
32- p = Path("..") / feature_file
33- if p.exists():
34- _feature_cache[feature_file] = parse_feature_file(p)
35+ feature_file = feature_file_for_nodeid(nodeid)
36+ key = str(feature_file) if feature_file else nodeid
37+ if key not in _feature_cache:
38+ if feature_file is not None:
39+ _feature_cache[key] = parse_feature_file(feature_file)
3540 else:
36- _feature_cache[feature_file ] = {}
37- return _feature_cache[feature_file ] or None
41+ _feature_cache[key ] = {}
42+ return _feature_cache[key ] or None
3843
3944
4045def _get_steps(item) -> list[str]:
0 commit comments