Skip to content

Commit 32409f6

Browse files
committed
enh(build): replace numpy with pytest...
numpy was used just for its assert_raise
1 parent 617e577 commit 32409f6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
extras_require={
3636
'plot': ['pydot', 'matplotlib']
3737
},
38-
tests_require=['numpy'],
38+
tests_require=['pytest'],
3939
license='Apache-2.0',
4040
keywords=['graph', 'computation graph', 'DAG', 'directed acyclical graph'],
4141
classifiers=[

test/test_graphkit.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
from pprint import pprint
88
from operator import add
9-
from numpy.testing import assert_raises
9+
10+
import pytest
1011

1112
import graphkit.network as network
1213
import graphkit.modifiers as modifiers
@@ -180,9 +181,10 @@ def test_pruning_raises_for_bad_output():
180181

181182
# Request two outputs we can compute and one we can't compute. Assert
182183
# that this raises a ValueError.
183-
assert_raises(ValueError, net, {'a': 1, 'b': 2, 'c': 3, 'd': 4},
184-
outputs=['sum1', 'sum3', 'sum4'])
185-
184+
with pytest.raises(ValueError) as exinfo:
185+
net({'a': 1, 'b': 2, 'c': 3, 'd': 4},
186+
outputs=['sum1', 'sum3', 'sum4'])
187+
assert exinfo.match('sum4')
186188

187189
def test_optional():
188190
# Test that optional() needs work as expected.

0 commit comments

Comments
 (0)