MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_path_deepcopy

Function test_path_deepcopy

lib/matplotlib/tests/test_path.py:354–373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

352
353
354def test_path_deepcopy():
355 # Should not raise any error
356 verts = [[0, 0], [1, 1]]
357 codes = [Path.MOVETO, Path.LINETO]
358 path1 = Path(verts, readonly=True)
359 path2 = Path(verts, codes, readonly=True)
360 path1_copy = path1.deepcopy()
361 path2_copy = path2.deepcopy()
362 assert path1 is not path1_copy
363 assert path1.vertices is not path1_copy.vertices
364 assert_array_equal(path1.vertices, path1_copy.vertices)
365 assert path1.readonly
366 assert not path1_copy.readonly
367 assert path2 is not path2_copy
368 assert path2.vertices is not path2_copy.vertices
369 assert_array_equal(path2.vertices, path2_copy.vertices)
370 assert path2.codes is not path2_copy.codes
371 assert_array_equal(path2.codes, path2_copy.codes)
372 assert path2.readonly
373 assert not path2_copy.readonly
374
375
376def test_path_deepcopy_cycle():

Callers

nothing calls this directly

Calls 2

deepcopyMethod · 0.95
PathClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…