Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 935f920

Browse files
committed
Test that affine2d not decalred valid on access.
1 parent c04a641 commit 935f920

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/matplotlib/tests/test_transforms.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,17 @@ def test_Affine2D_from_values():
176176
assert_almost_equal(actual, expected)
177177

178178

179+
def test_affine_inverted_invalidated():
180+
# Ensure that the an affine transform is not declared valid on access
181+
point = [1.0, 1.0]
182+
t = mtransforms.Affine2D()
183+
184+
assert_almost_equal(point, t.transform(t.inverted().transform(point)))
185+
# Change and access the transform
186+
t.translate(1.0, 1.0).get_matrix()
187+
assert_almost_equal(point, t.transform(t.inverted().transform(point)))
188+
189+
179190
def test_clipping_of_log():
180191
# issue 804
181192
M, L, C = Path.MOVETO, Path.LINETO, Path.CLOSEPOLY

0 commit comments

Comments
 (0)