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

Skip to content

Commit b554c8c

Browse files
committed
Got rid of unnecessary 'raise...as' statements.
1 parent 56d62c6 commit b554c8c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,20 +642,20 @@ def test_sticky_shared_axes(fig_test, fig_ref):
642642

643643

644644
def test_nargs_stem():
645-
with pytest.raises(TypeError, match='0 were given') as e:
645+
with pytest.raises(TypeError, match='0 were given'):
646646
# stem() takes 1-3 arguments.
647647
plt.stem()
648648

649649

650650
def test_nargs_legend():
651-
with pytest.raises(TypeError, match='3 were given') as e:
651+
with pytest.raises(TypeError, match='3 were given'):
652652
ax = plt.subplot()
653653
# legend() takes 0-2 arguments.
654654
ax.legend(['First'], ['Second'], 3)
655655

656656

657657
def test_nargs_pcolorfast():
658-
with pytest.raises(TypeError, match='2 were given') as e:
658+
with pytest.raises(TypeError, match='2 were given'):
659659
ax = plt.subplot()
660660
# pcolorfast() takes 1 or 3 arguments,
661661
# not passing any arguments fails at C = args[-1]

lib/matplotlib/tests/test_rcparams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_rcparams_init():
120120

121121
def test_nargs_cycler():
122122
from matplotlib.rcsetup import cycler as ccl
123-
with pytest.raises(TypeError, match='3 were given') as e:
123+
with pytest.raises(TypeError, match='3 were given'):
124124
# cycler() takes 0-2 arguments.
125125
ccl(ccl(color=list('rgb')), 2, 3)
126126

0 commit comments

Comments
 (0)