Skip to content

WCSAxes test_format_coord_regression fails when plt.ion() is set #5691

Description

@pllim

I get the following failure when testing Astropy (dev version) on my machine:

____________ test_format_coord_regression ____________
tmpdir = local('/tmp/pytest-of-lim/pytest-5/test_format_coord_regression0')

    def test_format_coord_regression(tmpdir):
        # Regression test for a bug that meant that if format_coord was called by
        # Matplotlib before the axes were drawn, an error occurred.
        fig = plt.figure(figsize=(3, 3))
        ax = WCSAxes(fig, [0.1, 0.1, 0.8, 0.8])
        fig.add_axes(ax)
>       assert ax.format_coord(10, 10) == ""
E       assert '11.0 11.0 (world)' == ''
E         - 11.0 11.0 (world)

astropy/visualization/wcsaxes/tests/test_misc.py:34: AssertionError

This is because I have plt.ion() set as a default behavior (as I want it to be). When I manually set plt.ioff() first before running that code snippet, it passes. Hence, this test is flaky and will fail for some people.

Activity

  1. pllim commented on May 11, 2017

    @pllim
    MemberAuthor

    Since this only affects one test on local machine under specific circumstance, I am closing this as "won't fix". We can always revisit if enough people complain about it.

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