diff options
| author | Michael Merickel <michael@merickel.org> | 2015-02-11 12:25:02 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2015-02-11 12:25:02 -0600 |
| commit | 14126cae5cf308ed466ed3eea576094e9c2193b4 (patch) | |
| tree | f5f8c1a7b6aa0780f4829c4cd60ca793c08f1de6 | |
| parent | 11ba5a50ef1c3c8eba4d58d0af0333f6bfe5ae61 (diff) | |
| download | pyramid-14126cae5cf308ed466ed3eea576094e9c2193b4.tar.gz pyramid-14126cae5cf308ed466ed3eea576094e9c2193b4.tar.bz2 pyramid-14126cae5cf308ed466ed3eea576094e9c2193b4.zip | |
fix up tests to generate coverage reports always and combine at the end
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | .travis.yml | 21 | ||||
| -rw-r--r-- | pyramid/tests/test_config/pkgs/asset/models.py | 8 | ||||
| -rw-r--r-- | pyramid/tests/test_config/pkgs/asset/views.py | 22 | ||||
| -rw-r--r-- | pyramid/tests/test_scripts/pystartup.py | 1 | ||||
| -rw-r--r-- | pyramid/tests/test_scripts/pystartup.txt | 3 | ||||
| -rw-r--r-- | pyramid/tests/test_scripts/test_pshell.py | 2 | ||||
| -rw-r--r-- | setup.cfg | 1 | ||||
| -rw-r--r-- | tox.ini | 27 |
9 files changed, 32 insertions, 56 deletions
diff --git a/.gitignore b/.gitignore index 8dca2069c..b60cd530a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,12 @@ *~ .*.swp .coverage +.coverage.* .tox/ nosetests.xml coverage.xml +nosetests-*.xml +coverage-*.xml tutorial.db build/ dist/ diff --git a/.travis.yml b/.travis.yml index e2f379802..7cf2b6a16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/pyramid/tests/test_config/pkgs/asset/models.py b/pyramid/tests/test_config/pkgs/asset/models.py deleted file mode 100644 index d80d14bb3..000000000 --- a/pyramid/tests/test_config/pkgs/asset/models.py +++ /dev/null @@ -1,8 +0,0 @@ -from zope.interface import Interface - -class IFixture(Interface): - pass - -def fixture(): - """ """ - diff --git a/pyramid/tests/test_config/pkgs/asset/views.py b/pyramid/tests/test_config/pkgs/asset/views.py deleted file mode 100644 index cbfc5a574..000000000 --- a/pyramid/tests/test_config/pkgs/asset/views.py +++ /dev/null @@ -1,22 +0,0 @@ -from zope.interface import Interface -from webob import Response -from pyramid.httpexceptions import HTTPForbidden - -def fixture_view(context, request): - """ """ - return Response('fixture') - -def erroneous_view(context, request): - """ """ - raise RuntimeError() - -def exception_view(context, request): - """ """ - return Response('supressed') - -def protected_view(context, request): - """ """ - raise HTTPForbidden() - -class IDummy(Interface): - pass diff --git a/pyramid/tests/test_scripts/pystartup.py b/pyramid/tests/test_scripts/pystartup.py deleted file mode 100644 index c4e5bcc80..000000000 --- a/pyramid/tests/test_scripts/pystartup.py +++ /dev/null @@ -1 +0,0 @@ -foo = 1 diff --git a/pyramid/tests/test_scripts/pystartup.txt b/pyramid/tests/test_scripts/pystartup.txt new file mode 100644 index 000000000..c62c4ca74 --- /dev/null +++ b/pyramid/tests/test_scripts/pystartup.txt @@ -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 diff --git a/pyramid/tests/test_scripts/test_pshell.py b/pyramid/tests/test_scripts/test_pshell.py index a6ba2eaea..dab32fecd 100644 --- a/pyramid/tests/test_scripts/test_pshell.py +++ b/pyramid/tests/test_scripts/test_pshell.py @@ -379,7 +379,7 @@ class TestPShellCommand(unittest.TestCase): 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') @@ -5,7 +5,6 @@ zip_ok = false match=^test where=pyramid nocapture=1 -cover-package=pyramid [aliases] dev = develop easy_install pyramid[testing] @@ -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. - |
