Skip to content

Test failure with Matplotlib 3.11.0rc1 #75

Description

@QuLogic

When testing a build against Matplotlib 3.11.0rc1, there is one test failure:

__________________________________ test_info ___________________________________

    def test_info():
        fig = plt.figure()
        ax = fig.add_subplot(111)
    
        data = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
        ax.imshow(data)
    
        scalebar = ScaleBar(0.5)
        ax.add_artist(scalebar)
    
        with pytest.raises(ValueError):
            scalebar.info
    
        plt.draw()
    
        info = scalebar.info
        assert info.length_px == pytest.approx(0.4, 1e-4)
        assert info.value == pytest.approx(2, 1e-4)
        assert info.units == "dm"
        assert info.scale_text == "2 dm"
        assert info.window_extent.x0 == pytest.approx(456.5755555555555, 1e-4)
>       assert info.window_extent.y0 == pytest.approx(390.81511111111104, 1e-4)
E       assert np.float64(390.47852256944435) == 390.81511111111104 ± 0.0390815
E         
E         comparison failed
E         Obtained: 390.47852256944435
E         Expected: 390.81511111111104 ± 0.0390815

tests/test_scalebar.py:395: AssertionError

Since there's some text involved, you can probably just adjust the tolerance on the comparison.

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

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions