Skip to content

Commit cb1f5c9

Browse files
committed
TST: Move PV tests into own class
1 parent 196184c commit cb1f5c9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

numpy_financial/tests/test_financial.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@
1313

1414

1515
class TestFinancial(object):
16-
def test_pv(self):
17-
assert_almost_equal(npf.pv(0.07, 20, 12000, 0), -127128.17, 2)
18-
19-
def test_pv_decimal(self):
20-
assert_equal(npf.pv(Decimal('0.07'), Decimal('20'), Decimal('12000'),
21-
Decimal('0')),
22-
Decimal('-127128.1709461939327295222005'))
23-
2416
def test_when(self):
2517
# begin
2618
assert_equal(npf.rate(10, 20, -3500, 10000, 1),
@@ -93,6 +85,16 @@ def test_decimal_with_when(self):
9385
Decimal('0'), 'end'))
9486

9587

88+
class TestPV:
89+
def test_pv(self):
90+
assert_almost_equal(npf.pv(0.07, 20, 12000, 0), -127128.17, 2)
91+
92+
def test_pv_decimal(self):
93+
assert_equal(npf.pv(Decimal('0.07'), Decimal('20'), Decimal('12000'),
94+
Decimal('0')),
95+
Decimal('-127128.1709461939327295222005'))
96+
97+
9698
class TestRate:
9799
def test_rate(self):
98100
assert_almost_equal(npf.rate(10, 0, -3500, 10000), 0.1107, 4)

0 commit comments

Comments
 (0)