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

Tests fail with latest Traits and TraitsUI from PyPI #1748

Open
mdickinson opened this issue Jun 26, 2023 · 1 comment
Open

Tests fail with latest Traits and TraitsUI from PyPI #1748

mdickinson opened this issue Jun 26, 2023 · 1 comment
Labels
component: test suite Issues related directly to the test suite type: bug

Comments

@mdickinson
Copy link
Member

I'm seeing a test failure with the latest Traits and TraitsUI from PyPI, on Python 3.11. (I haven't tested with other Python versions, but it likely affects those, too.)

Steps to reproduce:

  • Create a new Python 3.11 venv, and activate it.
  • Run pip install traits traitsui
  • Run python -m unittest discover -v traits

Expected results: the test suite runs to completion.

Actual results: we get the following test failure:

======================================================================
FAIL: test_edit_not_given (traits.tests.test_configure_traits.TestConfigureTraits.test_edit_not_given)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mdickinson/.venvs/traits/lib/python3.11/site-packages/traits/tests/test_configure_traits.py", line 158, in test_edit_not_given
    self.assertEqual(len(captured_warnings), 0)
AssertionError: 2 != 0

----------------------------------------------------------------------

This is likely to be an overzealous test, but as well as tightening this test, we should investigate what the warnings are, where they're coming from, and how we can fix them.

@mdickinson mdickinson added type: bug component: test suite Issues related directly to the test suite labels Jun 26, 2023
@mdickinson
Copy link
Member Author

The warnings are both the same:

(Pdb) p [warning.message for warning in captured_warnings]
[DeprecationWarning("traitsui.__version__ is deprecated, use impportlib.metadata.version('traitsui') "), DeprecationWarning("traitsui.__version__ is deprecated, use impportlib.metadata.version('traitsui') ")]

We've already updated the Traits main branch not to use traitsui.__version__, but there hasn't been a Traits release since; these CI jobs will only stop failing when we make a Traits release.

Separately, we should fix the test so that it doesn't fail on unrelated warnings.

mdickinson added a commit that referenced this issue Jun 26, 2023
This PR fixes one part of the cause of #1748, namely that a test was
failing on warnings that were unrelated to the test purpose.
mdickinson added a commit that referenced this issue Jul 10, 2023
This PR fixes one part of the cause of #1748, namely that a test was
failing on warnings that were unrelated to the test purpose.
mdickinson added a commit that referenced this issue Jul 26, 2023
This PR fixes one part of the cause of #1748, namely that a test was
failing on warnings that were unrelated to the test purpose.

(cherry picked from commit d066c6d)
mdickinson added a commit that referenced this issue Jul 26, 2023
This PR fixes one part of the cause of #1748, namely that a test was
failing on warnings that were unrelated to the test purpose.

(cherry picked from commit d066c6d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: test suite Issues related directly to the test suite type: bug
Projects
None yet
Development

No branches or pull requests

1 participant