Skip to content

Commit ac53a0a

Browse files
bnavigatorroryyorke
authored andcommitted
switch to pytest for python-control on travis, combine coverage for coveralls
1 parent ee1f019 commit ac53a0a

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

.coveragerc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
[run]
22
source = slycot
3-
omit = */tests/*
3+
omit =
4+
*/tests/*
5+
*/version.py
6+
7+
8+
# please do not add any sections after this block
9+
# the CI will add the slycot modules as last line here
10+
[paths]
11+
source =
12+
slycot/

.travis.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,24 @@ install:
138138
139139
script:
140140
# slycots own unit tests as installed, not those from source dir
141-
- cd ..
141+
- mkdir ../slycot-coverage
142+
- cd ../slycot-coverage
142143
- slycot_dir=$(python -c "import slycot; print(slycot.__path__[0])")
143-
- pytest --pyargs slycot --cov=$slycot_dir --cov-config=Slycot/.coveragerc
144-
#
145-
# As a deeper set of tests, get test against python-control as well
144+
- pytest --pyargs slycot --cov=$slycot_dir --cov-config=../Slycot/.coveragerc
146145
#
147-
# Get python-control from source and install
148-
- git clone --depth 1 https://github.com/python-control/python-control.git control
149-
- cd control
150-
- python setup.py test
146+
# As a deeper set of tests, use the suite from python-control master branch as well
147+
- cd ..
148+
- git clone --depth 1 https://github.com/python-control/python-control.git
149+
- cd python-control
150+
- pytest --disable-warnings --cov=$slycot_dir --cov-config=../Slycot/.coveragerc control/tests
151+
151152

152153
after_success:
154+
# go back to Slycot dir and merge the coverage to report correct repo data with coveralls
155+
- cd ../Slycot
156+
- cp ../slycot-coverage/.coverage .coverage.slycot
157+
- cp ../python-control/.coverage .coverage.control
158+
- echo " $slycot_dir" >> .coveragerc
159+
- coverage combine
160+
- coverage report
153161
- coveralls

0 commit comments

Comments
 (0)