Skip to content

Commit

Permalink
MERGE PYTEST into PLOT to parametrize TCs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ankostis committed Oct 5, 2019
2 parents 1471551 + 4e55b30 commit af7ae0f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python:
- "2.7"
- "3.4"
- "3.5"

addons:
apt:
packages:
Expand All @@ -13,13 +14,13 @@ addons:
install:
- pip install Sphinx sphinx_rtd_theme codecov packaging
- "python -c $'import os, packaging.version as version\\nv = version.parse(os.environ.get(\"TRAVIS_TAG\", \"1.0\")).public\\nwith open(\"VERSION\", \"w\") as f: f.write(v)'"
- pip install .[plot]
- pip install -e .[test]
- cd docs
- make clean html
- cd ..

script:
- python setup.py nosetests --with-coverage --cover-package=graphkit
- pytest -v --cov=graphkit

deploy:
provider: pypi
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
"networkx == 2.2; python_version < '3.5'",
],
extras_require={
'plot': ['pydot', 'matplotlib']
'plot': ['pydot', 'matplotlib'],
'test': ['pydot', 'matplotlib', 'pytest', "pytest-cov"],
},
tests_require=[
"numpy",
"pytest",
"pytest-cov",
"ipython; python_version >= '3.5'", # to test jupyter plot.
"pydot", # to test plot
"matplotlib" # to test plot
Expand Down
10 changes: 6 additions & 4 deletions test/test_graphkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

from pprint import pprint
from operator import add
from numpy.testing import assert_raises

import pytest

import graphkit.network as network
import graphkit.modifiers as modifiers
Expand Down Expand Up @@ -261,9 +262,10 @@ def test_pruning_raises_for_bad_output():

# Request two outputs we can compute and one we can't compute. Assert
# that this raises a ValueError.
assert_raises(ValueError, net, {'a': 1, 'b': 2, 'c': 3, 'd': 4},
outputs=['sum1', 'sum3', 'sum4'])

with pytest.raises(ValueError) as exinfo:
net({'a': 1, 'b': 2, 'c': 3, 'd': 4},
outputs=['sum1', 'sum3', 'sum4'])
assert exinfo.match('sum4')

def test_optional():
# Test that optional() needs work as expected.
Expand Down

0 comments on commit af7ae0f

Please sign in to comment.