Skip to content

Commit

Permalink
fix up tests to generate coverage reports always and combine at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerickel committed Feb 11, 2015
1 parent 11ba5a5 commit 14126ca
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 56 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
*~
.*.swp
.coverage
.coverage.*
.tox/
nosetests.xml
coverage.xml
nosetests-*.xml
coverage-*.xml
tutorial.db
build/
dist/
Expand Down
21 changes: 10 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Wire up travis
language: python
#
#env:
# - TOXENV=clean
# - TOXENV=py26
# - TOXENV=py27
# - TOXENV=py32
# - TOXENV=py33
# - TOXENV=py34
# - TOXENV=pypy
# - TOXENV=pypy3
# - TOXENV=report

env:
- TOXENV=py26
- TOXENV=py27
- TOXENV=py32
- TOXENV=py33
- TOXENV=py34
- TOXENV=pypy
- TOXENV=pypy3
- TOXENV=py26,py32,cover

install:
- travis_retry pip install tox
Expand Down
8 changes: 0 additions & 8 deletions pyramid/tests/test_config/pkgs/asset/models.py

This file was deleted.

22 changes: 0 additions & 22 deletions pyramid/tests/test_config/pkgs/asset/views.py

This file was deleted.

1 change: 0 additions & 1 deletion pyramid/tests/test_scripts/pystartup.py

This file was deleted.

3 changes: 3 additions & 0 deletions pyramid/tests/test_scripts/pystartup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# this file has a .txt extension to avoid coverage reports
# since it is not imported but rather the contents are read and exec'd
foo = 1
2 changes: 1 addition & 1 deletion pyramid/tests/test_scripts/test_pshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def test_command_loads_pythonstartup(self):
os.path.abspath(
os.path.join(
os.path.dirname(__file__),
'pystartup.py')))
'pystartup.txt')))
shell = dummy.DummyShell()
command.run(shell)
self.assertEqual(self.bootstrap.a[0], '/foo/bar/myapp.ini#myapp')
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ zip_ok = false
match=^test
where=pyramid
nocapture=1
cover-package=pyramid

[aliases]
dev = develop easy_install pyramid[testing]
Expand Down
27 changes: 15 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
[tox]
skipsdist = True
envlist =
clean,py26,py27,py32,py33,py34,pypy,pypy3,report

[testenv:clean]
commands = coverage erase
deps = coverage
py26,py27,py32,py33,py34,pypy,pypy3,cover

[testenv]
commands =
python setup.py dev
python setup.py nosetests --with-coverage
{envbindir}/python setup.py dev
{envbindir}/coverage run --source={toxinidir}/pyramid {envbindir}/nosetests --xunit-file=nosetests-{envname}.xml
{envbindir}/coverage xml -o coverage-{envname}.xml
setenv =
COVERAGE_FILE=.coverage.{envname}

[testenv:report]
[testenv:cover]
commands =
python setup.py dev
python setup.py nosetests --with-xunit --with-xcoverage --cover-min-percentage=100
{envbindir}/coverage erase
{envbindir}/coverage combine
{envbindir}/coverage xml
{envbindir}/coverage report --show-missing --fail-under=100
deps =
nosexcover
coverage
setenv =
COVERAGE_FILE=.coverage

# we separate coverage into its own testenv because a) "last run wins" wrt
# cobertura jenkins reporting and b) pypy and jython can't handle any
# combination of versions of coverage and nosexcover that i can find.

0 comments on commit 14126ca

Please sign in to comment.