Skip to content

Commit 8077d64

Browse files
Merge pull request #76 from brandonwillard/update-coverage-settings
Add branch diff coverage check and ignore utility functions
2 parents a68a2a9 + b1ef82f commit 8077d64

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help venv conda docker docstyle format style black test lint check
1+
.PHONY: help venv conda docker docstyle format style black test lint check coverage
22
.DEFAULT_GOAL = help
33

44
PYTHON = python
@@ -58,8 +58,11 @@ black: # Format code in-place using black.
5858
black symbolic_pymc/
5959

6060
test: # Test code using pytest.
61-
pytest -v tests/ --cov=symbolic_pymc/ --html=testing-report.html --self-contained-html
61+
pytest -v tests/ --cov=symbolic_pymc/ --cov-report=xml --html=testing-report.html --self-contained-html
62+
63+
coverage: test
64+
diff-cover coverage.xml --compare-branch=master --fail-under=100
6265

6366
lint: docstyle format style # Lint code using pydocstyle, black and pylint.
6467

65-
check: lint test # Both lint and test code. Runs `make lint` followed by `make test`.
68+
check: lint test coverage # Both lint and test code. Runs `make lint` followed by `make test`.

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ pytest-cov>=2.6.1
44
pytest-html>=1.20.0
55
pylint>=2.3.1
66
black>=19.3b0
7+
diff-cover
78
ipython

setup.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ convention = numpy
99
python_functions=test_*
1010
filterwarnings =
1111
ignore:the imp module is deprecated:DeprecationWarning:
12-
ignore:Using a non-tuple sequence:FutureWarning:theano\.tensor
12+
ignore:Using a non-tuple sequence:FutureWarning:theano\.tensor
13+
14+
[coverage:report]
15+
exclude_lines =
16+
pragma: no cover

symbolic_pymc/unify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class UnificationFailure(Exception):
2020
pass
2121

2222

23-
def debug_unify(enable=True):
23+
def debug_unify(enable=True): # pragma: no cover
2424
"""Wrap unify functions so that they raise a `UnificationFailure` exception when unification fails."""
2525
if enable:
2626

symbolic_pymc/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def _check_eq(a, b):
1010
return a == b
1111

1212

13-
def meta_parts_unequal(x, y, pdb=False):
13+
def meta_parts_unequal(x, y, pdb=False): # pragma: no cover
1414
"""Traverse meta objects and return the first pair of elements that are not equal."""
1515
res = None
1616
if type(x) != type(y):

0 commit comments

Comments
 (0)