Skip to content

Commit fc40b0e

Browse files
committed
STY: Fix line too long errors from style check
1 parent 0c4c874 commit fc40b0e

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

tests/test_financial.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ def test_mirr(self, values, finance_rate, reinvest_rate, expected):
257257
@pytest.mark.parametrize(
258258
"args, expected",
259259
[
260-
({'values': ['-4500', '-800', '800', '800', '600', '600', '800', '800', '700', '3000'],
260+
({'values': [
261+
'-4500', '-800', '800', '800', '600', '600', '800', '800', '700', '3000'
262+
],
261263
'finance_rate': '0.08', 'reinvest_rate': '0.055'
262264
}, '0.066597175031553548874239618'
263265
),
@@ -277,7 +279,11 @@ def test_mirr(self, values, finance_rate, reinvest_rate, expected):
277279
)
278280
def test_mirr_decimal(self, number_type, args, expected):
279281
values = [number_type(v) for v in args['values']]
280-
result = npf.mirr(values, number_type(args['finance_rate']), number_type(args['reinvest_rate']))
282+
result = npf.mirr(
283+
values,
284+
number_type(args['finance_rate']),
285+
number_type(args['reinvest_rate'])
286+
)
281287

282288
if expected is not numpy.nan:
283289
assert_almost_equal(result, number_type(expected), 15)
@@ -289,7 +295,9 @@ def test_mirr_no_real_solution_exception(self):
289295
# have the same sign, then npf.mirr returns NoRealSolutionException
290296
# when raise_exceptions is set to True.
291297
val = [39000, 30000, 21000, 37000, 46000]
292-
assert_raises(npf.NoRealSolutionError, npf.mirr, val, 0.10, 0.12, raise_exceptions=True)
298+
299+
with pytest.raises(npf.NoRealSolutionError):
300+
npf.mirr(val, 0.10, 0.12, raise_exceptions=True)
293301

294302

295303
class TestNper:
@@ -721,12 +729,15 @@ def test_irr_no_real_solution_exception(self):
721729
# have the same sign, then npf.irr returns NoRealSolutionException
722730
# when raise_exceptions is set to True.
723731
cashflows = numpy.array([40000, 5000, 8000, 12000, 30000])
724-
assert_raises(npf.NoRealSolutionError, npf.irr, cashflows, raise_exceptions=True)
732+
733+
with pytest.raises(npf.NoRealSolutionError):
734+
npf.irr(cashflows, raise_exceptions=True)
725735

726736
def test_irr_maximum_iterations_exception(self):
727737
# Test that if the maximum number of iterations is reached,
728738
# then npf.irr returns IterationsExceededException
729739
# when raise_exceptions is set to True.
730740
cashflows = numpy.array([-40000, 5000, 8000, 12000, 30000])
731-
assert_raises(npf.IterationsExceededError, npf.irr, cashflows,
732-
maxiter=1, raise_exceptions=True)
741+
742+
with pytest.raises(npf.IterationsExceededError):
743+
npf.irr(cashflows, maxiter=1, raise_exceptions=True)

0 commit comments

Comments
 (0)