TST: Any loaded backend may break CallbackRegistry exception tests · Issue #31049 · matplotlib/matplotlib · GitHub
Skip to content

TST: Any loaded backend may break CallbackRegistry exception tests #31049

Description

@QuLogic

While looking at #31031, I noticed that sometimes, the test that was supposed to fail didn't. Some investigation showed that this was due to a test with a GUI toolkit running beforehand. What happens is, if there is no running GUI toolkit, then an exception in a callback will raise:


If a test with Qt runs, though, then it will count as running forever:

Unlike, e.g., GTK, all that's required is that an application instance is connected, so this is permanent.

If there are tests that check exceptions, this would be noticed rather quickly. However, in the linked case, the test is more of a negative check, trying to prove that no exception occurs. The problem here is that we may in the future silently break any such test, since an exception that should have occurred may not raise after Qt is loaded.

Probably the simplest fix is to move any test that uses a backend explicitly into a subprocess. But I did not count how many that would be and whether that might cause an undue burden on testing infrastructure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions