Skip to content

Commit 650b902

Browse files
committed
Add more debug output
1 parent e3c579f commit 650b902

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/test_examples.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,13 +1007,25 @@ def test_example_shortcuts(tmp_path, request):
10071007
break
10081008
else:
10091009
# Debug: list what's actually in the Start Menu
1010+
print(f"\n=== Shortcut check failed for {installer.name} ===")
10101011
for key in ("ProgramData", "AppData"):
10111012
start_menu = Path(os.environ[key]) / "Microsoft/Windows/Start Menu/Programs"
10121013
if start_menu.exists():
10131014
print(f"{key} Start Menu contents: {list(start_menu.iterdir())}")
10141015
else:
10151016
print(f"{key} Start Menu path does not exist: {start_menu}")
1016-
raise AssertionError("No shortcuts found!")
1017+
# Print install.log if available
1018+
install_log = install_dir / "install.log"
1019+
if install_log.exists():
1020+
print(f"\n=== install.log from {install_dir} ===")
1021+
try:
1022+
print(install_log.read_text(encoding="utf-16-le"))
1023+
except Exception:
1024+
try:
1025+
print(install_log.read_text(encoding="utf-8"))
1026+
except Exception as e:
1027+
print(f"Could not read install.log: {e}")
1028+
raise AssertionError(f"No shortcuts found for {installer.name}!")
10171029
if installer.suffix == ".msi":
10181030
_run_uninstaller_msi(installer, install_dir)
10191031
else:

0 commit comments

Comments
 (0)