Skip to content

Commit c5fbf7f

Browse files
committed
Enhance pytest report header to include Git information for modules
1 parent c8fec2a commit c5fbf7f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

plotpy/tests/conftest.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import tifffile
1515
from guidata.config import ValidationMode, set_validation_mode
1616
from guidata.env import execenv
17+
from guidata.utils.gitreport import format_git_info_for_pytest, get_git_info_for_modules
1718

1819
import plotpy
1920

@@ -76,11 +77,23 @@ def pytest_report_header(config):
7677
qtbindings_version = qtpy.PYSIDE_VERSION
7778
if qtbindings_version is None:
7879
qtbindings_version = qtpy.PYQT_VERSION
79-
return [
80+
infolist = [
8081
f"PlotPy {plotpy.__version__}",
8182
f" guidata {guidata.__version__}, PythonQwt {qwt.__version__}, "
8283
f"{qtpy.API_NAME} {qtbindings_version} [Qt version: {qtpy.QT_VERSION}]",
8384
f" NumPy {numpy.__version__}, SciPy {scipy.__version__}, "
8485
f"h5py {h5py.__version__}, Pillow {PIL.__version__}, "
8586
f"tifffile {tifffile.__version__}",
8687
]
88+
89+
# Git information for all modules using the gitreport module
90+
modules_config = [
91+
("PlotPy", plotpy, "."), # PlotPy uses current directory
92+
("guidata", guidata, None),
93+
]
94+
git_repos = get_git_info_for_modules(modules_config)
95+
git_info_lines = format_git_info_for_pytest(git_repos, "PlotPy")
96+
if git_info_lines:
97+
infolist.extend(git_info_lines)
98+
99+
return infolist

0 commit comments

Comments
 (0)