enthought / enthought/pyface

Bug report: (some) tests should be skipped when ETS_TOOLKIT=qt4

Open
#1,252 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
115
Forks
54
PR merge metrics
No merged PRs in 30d

Description

## Environment

OS: _all_
Python version: _3.8_
Toolkit: _Qt_
Qt API: _PySide6_

## Description

Tests fail when ETS_TOOLKIT is set to 'qt4'. The TestQt4ImportHooks assume that the qt4 modules have not been imported yet which is probably not true in this case. I think that the testcase should detect that ETS_TOOLKIT is qt4 and skip the related tests or ask the user to stop using the qt4 value.

## Steps to Reproduce

```
export ETS_TOOLKIT=qt4
export QT_API=pyside6
export EXCLUDE_TESTS=wx
export CI=1
python -m unittest discover pyface
```

failed tests:
```
FAIL: test_qt4_import_no_hook (pyface.ui.qt.tests.test_qt4_import_hooks.TestQt4ImportHooks)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/itziakos/.edm/envs/build-env/lib/python3.8/site-packages/pyface/ui/qt/tests/test_qt4_import_hooks.py", line 33, in test_qt4_import_no_hook
import pyface.ui.qt4.tests.good_package.good_import # noqa F401
AssertionError: ModuleNotFoundError not raised

======================================================================
FAIL: test_qt4_import_other_package_hook (pyface.ui.qt.tests.test_qt4_import_hooks.TestQt4ImportHooks)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/itziakos/.edm/envs/build-env/lib/python3.8/site-packages/pyface/ui/qt/tests/test_qt4_import_hooks.py", line 53, in test_qt4_import_other_package_hook
import pyface.ui.qt4.tests.good_package.good_import # noqa F401
AssertionError: ModuleNotFoundError not raised

======================================================================
FAIL: test_qt4_import_with_ets_toolkit_qt (pyface.ui.qt.tests.test_qt4_import_hooks.TestQt4ImportHooks)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/itziakos/.edm/envs/build-env/lib/python3.8/site-packages/pyface/ui/qt/tests/test_qt4_import_hooks.py", line 171, in test_qt4_import_with_ets_toolkit_qt
import pyface.ui.qt4.tests.good_package.good_import # noqa F401
AssertionError: ModuleNotFoundError not raised

======================================================================
FAIL: test_qt4_import_with_etsconfig_toolkit_qt (pyface.ui.qt.tests.test_qt4_import_hooks.TestQt4ImportHooks)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/itziakos/.edm/envs/build-env/lib/python3.8/site-packages/pyface/ui/qt/tests/test_qt4_import_hooks.py", line 204, in test_qt4_import_with_etsconfig_toolkit_qt
import pyface.ui.qt4.tests.good_package.good_import # noqa F401
AssertionError: ModuleNotFoundError not raised
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.