Skip to content

Commit

Permalink
TST: optimize: fix pytest.raises usage typos
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed May 5, 2018
1 parent f5a8260 commit 1b80dba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scipy/optimize/tests/test_minpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def func(*args):

def test_Dfun_can_raise(self):
func = lambda x: x - np.array([10])

def deriv_func(*args):
raise ValueError('I raised')

Expand Down Expand Up @@ -348,15 +349,16 @@ def test_func_can_raise(self):
def func(*args):
raise ValueError('I raised')

with assert_raises(ValueError, matches='I raised'):
with assert_raises(ValueError, match='I raised'):
optimize.leastsq(func, x0=[0])

def test_Dfun_can_raise(self):
func = lambda x: x - np.array([10])

def deriv_func(*args):
raise ValueError('I raised')

with assert_raises(ValueError, matches='I raised'):
with assert_raises(ValueError, match='I raised'):
optimize.leastsq(func, x0=[0], Dfun=deriv_func)

def test_reentrant_func(self):
Expand Down

0 comments on commit 1b80dba

Please sign in to comment.