diff --git a/tests/conftest.py b/tests/conftest.py index b7101b83..c31a78aa 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,6 +2,9 @@ def pytest_configure(config): + """ + This function gets run by py.test at the very start + """ if 'USE_QT_API' in os.environ: os.environ['QT_API'] = os.environ['USE_QT_API'].lower() @@ -12,6 +15,10 @@ def pytest_configure(config): def pytest_report_header(config): + """ + This function is used by py.test to insert a customized header into the + test report. + """ versions = os.linesep versions += 'PyQt4: ' diff --git a/tests/test_main.py b/tests/test_main.py index 32b9d57f..3c8cfd99 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -4,6 +4,9 @@ def assert_pyside(): + """ + Make sure that we are using PySide + """ import PySide assert QtCore.QEvent is PySide.QtCore.QEvent assert QtGui.QPainter is PySide.QtGui.QPainter @@ -12,6 +15,9 @@ def assert_pyside(): def assert_pyqt4(): + """ + Make sure that we are using PyQt4 + """ import PyQt4 assert QtCore.QEvent is PyQt4.QtCore.QEvent assert QtGui.QPainter is PyQt4.QtGui.QPainter @@ -20,6 +26,9 @@ def assert_pyqt4(): def assert_pyqt5(): + """ + Make sure that we are using PyQt5 + """ import PyQt5 assert QtCore.QEvent is PyQt5.QtCore.QEvent assert QtGui.QPainter is PyQt5.QtGui.QPainter @@ -32,7 +41,7 @@ def test_qt_api(): If QT_API is specified, we check that the correct Qt wrapper was used """ - QT_API = os.environ.get('QT_API', None) + QT_API = os.environ.get('QT_API') if QT_API == 'pyside': assert_pyside()