Skip to content

Commit edcc3f9

Browse files
committed
Add pytest header with Qt versions
1 parent 7821fb8 commit edcc3f9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@
44

55
import os
66

7+
import qtpy
8+
9+
import qwt
710
from qwt.tests.utils import TestEnvironment
811

912
# Set the unattended environment variable to 1 to avoid any user interaction
1013
os.environ[TestEnvironment.UNATTENDED_ENV] = "1"
14+
15+
16+
def pytest_report_header(config):
17+
"""Add additional information to the pytest report header."""
18+
qtbindings_version = qtpy.PYSIDE_VERSION
19+
if qtbindings_version is None:
20+
qtbindings_version = qtpy.PYQT_VERSION
21+
return [
22+
f"PythonQwt {qwt.__version__} [closest Qwt version: {qwt.QWT_VERSION_STR}]",
23+
f"{qtpy.API_NAME} {qtbindings_version} [Qt version: {qtpy.QT_VERSION}]",
24+
]

0 commit comments

Comments
 (0)