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

Function test_path_exceptions

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

Source from the content-addressed store, hash-verified

34
35
36def test_path_exceptions():
37 bad_verts1 = np.arange(12).reshape(4, 3)
38 with pytest.raises(ValueError,
39 match=re.escape(f'has shape {bad_verts1.shape}')):
40 Path(bad_verts1)
41
42 bad_verts2 = np.arange(12).reshape(2, 3, 2)
43 with pytest.raises(ValueError,
44 match=re.escape(f'has shape {bad_verts2.shape}')):
45 Path(bad_verts2)
46
47 good_verts = np.arange(12).reshape(6, 2)
48 bad_codes = np.arange(2)
49 msg = re.escape(f"Your vertices have shape {good_verts.shape} "
50 f"but your codes have shape {bad_codes.shape}")
51 with pytest.raises(ValueError, match=msg):
52 Path(good_verts, bad_codes)
53
54
55def test_point_in_path():

Callers

nothing calls this directly

Calls 1

PathClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…