Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_configure_traits.py failed due to unexpected number of warnings in test_edit_not_given #1745

Closed
homosapien-lcy opened this issue Apr 21, 2023 · 0 comments · Fixed by #1746

Comments

@homosapien-lcy
Copy link
Contributor

homosapien-lcy commented Apr 21, 2023

This test (test_edit_not_given in traits/traits/tests/test_configure_traits.py) expceted 0 warnings raised but a depreciation warning due to traitsui.version generated 2 warnings which causes this test to fail

(py311) (base) cyliu@aus552cyliu traits % python3.11 -m unittest traits/tests/test_configure_traits.py
captured_warnings {'message': DeprecationWarning("traitsui.__version__ is deprecated, use impportlib.metadata.version('traitsui') "), 'category': <class 'DeprecationWarning'>, 'filename': '/Users/cyliu/.venvs/py311/lib/python3.11/site-packages/traitsui/__init__.py', 'lineno': 20, 'file': None, 'line': None, 'source': None, '_category_name': 'DeprecationWarning'}
F......./Users/cyliu/.venvs/py311/lib/python3.11/site-packages/traitsui/__init__.py:20: DeprecationWarning: traitsui.__version__ is deprecated, use impportlib.metadata.version('traitsui') 
  warn(
.
======================================================================
FAIL: test_edit_not_given (traits.tests.test_configure_traits.TestConfigureTraits.test_edit_not_given)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/cyliu/Documents/3.11_test/traits/traits/tests/test_configure_traits.py", line 159, in test_edit_not_given
    self.assertEqual(len(captured_warnings), 0)
AssertionError: 2 != 0

----------------------------------------------------------------------
Ran 9 tests in 0.048s

FAILED (failures=1)

Replication:

python traits/traits/tests/test_configure_traits.py

Expected behavior:
test past

System Setup:
MacOS, python3.11

Packages installed:
Package Version Editable project location


attrdict 2.0.1
attrdict3 2.0.2
celiagg 2.1.3
certifi 2022.12.7
chaco 5.1.0 /Users/cyliu/Documents/3.11_test/chaco
charset-normalizer 3.1.0
configobj 5.0.8
cPython 0.0.6
dnspython 2.3.0
enable 5.4.0.dev45 /Users/cyliu/Documents/3.11_test/enable
fonttools 4.39.2
idna 3.4
joblib 1.2.0
numpy 1.24.2
pandas 1.5.3
Pillow 9.4.0
pip 23.1
PyAudio 0.2.13
pyface 8.0.0
pygarrayimage 1.0
pyglet 2.0.5 /Users/cyliu/Documents/3.11_test/pyglet
Pygments 2.14.0
pymongo 4.3.3
pyparsing 3.0.9
PySide6 6.4.3
PySide6-Addons 6.4.3
PySide6-Essentials 6.4.3
python-dateutil 2.8.2
pythonw 3.0.3
pytz 2023.2
reportlab 3.6.12
requests 2.28.2
scikit-learn 1.2.2
scipy 1.10.1
setuptools 65.6.3
shiboken6 6.4.3
six 1.16.0
threadpoolctl 3.1.0
traits 7.0.0.dev1842 /Users/cyliu/Documents/3.11_test/traits
traitsui 8.0.0.dev0
urllib3 1.26.15
wxPython 4.2.0

After running

python3.11 -W error -m unittest traits/tests/test_configure_traits.py

The problem can be traced to

File "/Users/cyliu/Documents/3.11_test/traits/traits/util/_traitsui_helpers.py", line 33, in check_traitsui_major_version
from traitsui import version as traitsui_version

will address that in a PR

mdickinson pushed a commit that referenced this issue Apr 21, 2023
In traitsui, traitsui.__version__ has been deprecated and should be
replaced with importlib.metadata.version('traitsui'). The deprecation
warning raised have also caused test_edit_not_given in
traits/traits/tests/test_configure_traits.py to fail as mentioned in
#1745 . Since the version check is a temporary check to address the
dependency of traits on traits ui and is no longer need, the current PR
fixed this issue by removing all version checks related to
_traitsui_helpers.py.

Closes #1745

Co-authored-by: Chengyu Liu <[email protected]>
mdickinson pushed a commit that referenced this issue Jul 10, 2023
In traitsui, traitsui.__version__ has been deprecated and should be
replaced with importlib.metadata.version('traitsui'). The deprecation
warning raised have also caused test_edit_not_given in
traits/traits/tests/test_configure_traits.py to fail as mentioned in
#1745 . Since the version check is a temporary check to address the
dependency of traits on traits ui and is no longer need, the current PR
fixed this issue by removing all version checks related to
_traitsui_helpers.py.

Closes #1745

Co-authored-by: Chengyu Liu <[email protected]>
mdickinson pushed a commit that referenced this issue Jul 26, 2023
In traitsui, traitsui.__version__ has been deprecated and should be
replaced with importlib.metadata.version('traitsui'). The deprecation
warning raised have also caused test_edit_not_given in
traits/traits/tests/test_configure_traits.py to fail as mentioned in
#1745 . Since the version check is a temporary check to address the
dependency of traits on traits ui and is no longer need, the current PR
fixed this issue by removing all version checks related to
_traitsui_helpers.py.

Closes #1745

Co-authored-by: Chengyu Liu <[email protected]>
(cherry picked from commit 60f918e)
mdickinson pushed a commit that referenced this issue Jul 26, 2023
In traitsui, traitsui.__version__ has been deprecated and should be
replaced with importlib.metadata.version('traitsui'). The deprecation
warning raised have also caused test_edit_not_given in
traits/traits/tests/test_configure_traits.py to fail as mentioned in
#1745 . Since the version check is a temporary check to address the
dependency of traits on traits ui and is no longer need, the current PR
fixed this issue by removing all version checks related to
_traitsui_helpers.py.

Closes #1745

Co-authored-by: Chengyu Liu <[email protected]>
(cherry picked from commit 60f918e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant