8000 Update test_lines.py · matplotlib/matplotlib@9a134d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a134d5

Browse files
authored
Update test_lines.py
1 parent eb9f819 commit 9a134d5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/matplotlib/tests/test_lines.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,3 +436,14 @@ def test_axline_setters():
436436
with pytest.raises(ValueError,
437437
match="Cannot set a 'slope' value while 'xy2' is set"):
438438
line2.set_slope(3)
439+
440+
def test_line_slope():
441+
fig, ax = plt.subplots()
442+
line = ax.axline(xy1=(0, 0), slope=1E-8)
443+
444+
# Extract the slope from the line's properties
445+
slope = line.get_slope()
446+
447+
if slope == 0:
448+
with pytest.raises(ValueError, match="line should not be horizontal"):
449+
raise ValueError("line should not be horizontal")

0 commit comments

Comments
 (0)
0