Skip to content
This repository has been archived by the owner on Feb 7, 2025. It is now read-only.

Commit

Permalink
Add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster committed Sep 10, 2014
1 parent 83eef0e commit 7823812
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[run]
branch = true
source = indico
include = indico/modules/rb/models/*.py

[report]
exclude_lines =
pragma: no cover
def __repr__
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ node_modules
.noseids
indico/tests/report/*.txt
test.txt
.coverage
coverage.xml
htmlcov/
7 changes: 5 additions & 2 deletions indico/cli/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from flask_script import Command, Option
from werkzeug.debug import DebuggedApplication
from werkzeug.exceptions import NotFound
from werkzeug.wsgi import DispatcherMiddleware
from werkzeug.wsgi import DispatcherMiddleware, SharedDataMiddleware

from indico.core.config import Config
from indico.core.logger import Logger
Expand Down Expand Up @@ -331,7 +331,10 @@ def start_web_server(app, host='localhost', port=0, with_ssl=False, keep_base_ur
evalex_whitelist = True

console.info(' * Using BaseURL {0}'.format(base_url))
app = make_indico_dispatcher(app)
app.wsgi_app = make_indico_dispatcher(app.wsgi_app)
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
'/htmlcov': os.path.join(app.root_path, '..', 'htmlcov')
}, cache=False)
server = WerkzeugServer(app, host, used_port, reload_on_change=reload_on_change, evalex_whitelist=evalex_whitelist,
enable_ssl=with_ssl, ssl_cert=ssl_cert, ssl_key=ssl_key)
signal.signal(signal.SIGINT, _sigint)
Expand Down
4 changes: 2 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[pytest]
; exclude unrelated folders and all old tests
norecursedirs = .* .git indico/tests indico/modules/rb/tests test MaKaC doc etc ext_modules migrations
; more verbose summary (include skip/fail/error/warning), fixtures
addopts = -rsfEw
; more verbose summary (include skip/fail/error/warning), coverage
addopts = -rsfEw --cov indico --cov-report html --no-cov-on-fail
; only check for tests in suffixed files
python_files = *_test.py
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ py==1.4.23
pyPdf==1.13
pyatom==1.2
pycountry==1.2
cov-core==1.14.0
coverage==3.7.1
pytest==2.6.1
pytest-capturelog==0.7
pytest-cov==1.8.0
python-dateutil==1.5
pytz==2014.4
reportlab==2.5
Expand Down

0 comments on commit 7823812

Please sign in to comment.