The current answer here has two parts:
- pytest configuration
- coverage.py configuration
Let's start with the pytest configuration. Currently on your coverage
branch there is the .travis.yml
file with the following line: py.test --cov tests
, this tells pytest-cov to show you the coverage for the tests
directory, which you don't want.
You can run py.test tests --cov
instead or change your setup.cfg
and not pass the tests
at all.
You would then have the setup.cfg
file with:
[tool:pytest]
testpaths =
tests
In the .coverage
file you need:
[run]
plugins = Cython.Coverage
source = src/pyscipopt
omit =
tests
*__init__.py
Specifying the paths
separately is obsolete and I have removed it. This way coverage.py
knows that it should only check coverage for the src/pyscipopt
directory.
After these changes the output I got is:
---------- coverage: platform darwin, python 3.6.4-final-0 -----------
Name Stmts Miss Branch BrPart Cover
---------------------------------------------------------------
src/pyscipopt/Multidict.py 17 17 10 0 0%
src/pyscipopt/conshdlr.pxi 301 129 0 0 57%
src/pyscipopt/expr.pxi 168 57 0 0 66%
src/pyscipopt/heuristic.pxi 44 18 0 0 59%
src/pyscipopt/lp.pxi 235 177 0 0 25%
src/pyscipopt/pricer.pxi 52 24 0 0 54%
---------------------------------------------------------------
TOTAL 817 422 10 0 48%
This looks like the proper output you want, but I do see the scip.pyx
file is missing. You can also look at a related issue on github. I am not investigating further because it answers your question and I think you will be able to go from here with whatever is missing.