Merge pull request #76 from niphlod/feature/coverage
coverage integration
This commit is contained in:
+2
-2
@@ -29,10 +29,10 @@ matrix:
|
||||
- python: 'pypy'
|
||||
env: DB=mysql://root:@localhost/test_w2p
|
||||
|
||||
script: export COVERAGE_PROCESS_START=gluon/tests/.coveragerc; ./web2py.py --run_system_tests --with_coverage
|
||||
script: export COVERAGE_PROCESS_START=gluon/tests/coverage.ini; ./web2py.py --run_system_tests --with_coverage
|
||||
after_success:
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coverage combine; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls --config_file=gluon/tests/.coveragerc; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls --config_file=gluon/tests/coverage.ini; fi
|
||||
|
||||
notifications:
|
||||
email: true
|
||||
|
||||
@@ -518,7 +518,7 @@ CONTENT_TYPE = {
|
||||
'.pln': 'application/x-planperfect',
|
||||
'.pls': 'audio/x-scpls',
|
||||
'.pm': 'application/x-perl',
|
||||
'.png': 'image/x-apple-ios-png',
|
||||
'.png': 'image/png',
|
||||
'.pnm': 'image/x-portable-anymap',
|
||||
'.pntg': 'image/x-macpaint',
|
||||
'.po': 'text/x-gettext-translation',
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
[run]
|
||||
branch = True
|
||||
parallel = True
|
||||
source = gluon
|
||||
## remove comment if you want applications coverage too
|
||||
#source = gluon, applications
|
||||
|
||||
[report]
|
||||
# Regexes for lines to exclude from consideration
|
||||
exclude_lines =
|
||||
# Have to re-enable the standard pragma
|
||||
pragma: no cover
|
||||
|
||||
# Don't complain about missing debug-only code:
|
||||
def __repr__
|
||||
if self\.debug
|
||||
|
||||
# Don't complain if tests don't hit defensive assertion code:
|
||||
raise AssertionError
|
||||
raise NotImplementedError
|
||||
|
||||
# Don't complain if non-runnable code isn't run:
|
||||
if 0:
|
||||
if __name__ == .__main__.:
|
||||
|
||||
ignore_errors = True
|
||||
omit = gluon/contrib/*
|
||||
|
||||
[html]
|
||||
directory = coverage_html_report
|
||||
+7
-2
@@ -78,7 +78,9 @@ def run_system_tests(options):
|
||||
if options.with_coverage:
|
||||
try:
|
||||
import coverage
|
||||
coverage_config = os.path.join('gluon', 'tests', '.coveragerc')
|
||||
coverage_config = os.environ.get("COVERAGE_PROCESS_START",
|
||||
os.path.join('gluon', 'tests', 'coverage.ini')
|
||||
)
|
||||
call_args = ['coverage', 'run', '--rcfile=%s' % coverage_config,
|
||||
'-m', 'unittest', '-v', 'gluon.tests']
|
||||
except:
|
||||
@@ -916,7 +918,10 @@ def console():
|
||||
help=msg)
|
||||
|
||||
msg = ('adds coverage reporting (needs --run_system_tests), '
|
||||
'python 2.7 and the coverage module installed')
|
||||
'python 2.7 and the coverage module installed. '
|
||||
'You can alter the default path setting the environmental '
|
||||
'var "COVERAGE_PROCESS_START". '
|
||||
'By default it takes gluon/tests/coverage.ini')
|
||||
parser.add_option('--with_coverage',
|
||||
action='store_true',
|
||||
dest='with_coverage',
|
||||
|
||||
Reference in New Issue
Block a user