add 'coverage' environment for tox
This commit is contained in:
parent
88696dd0ed
commit
783cd984f6
|
@ -1,3 +1,5 @@
|
||||||
|
# -*- mode: conf -*-
|
||||||
|
|
||||||
[run]
|
[run]
|
||||||
# only record trace data for wormhole.*
|
# only record trace data for wormhole.*
|
||||||
source =
|
source =
|
||||||
|
|
16
src/wormhole/test/run_trial.py
Normal file
16
src/wormhole/test/run_trial.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
# This is a tiny helper module, to let "python -m wormhole.test.run_trial
|
||||||
|
# ARGS" does the same thing as running "trial ARGS" (unfortunately
|
||||||
|
# twisted/scripts/trial.py does not have a '__name__=="__main__"' clause).
|
||||||
|
#
|
||||||
|
# This makes it easier to run trial under coverage from tox:
|
||||||
|
# * "coverage run trial ARGS" is how you'd usually do it
|
||||||
|
# * but "trial" must be the one in tox's virtualenv
|
||||||
|
# * "coverage run `which trial` ARGS" works from a shell
|
||||||
|
# * but tox doesn't use a shell
|
||||||
|
# So use:
|
||||||
|
# "coverage run -m wormhole.test.run_trial ARGS"
|
||||||
|
|
||||||
|
from twisted.scripts.trial import run
|
||||||
|
|
||||||
|
run()
|
11
tox.ini
11
tox.ini
|
@ -32,3 +32,14 @@ commands =
|
||||||
# a script name (since "python -m twisted.scripts.trial" doesn't have a 'if
|
# a script name (since "python -m twisted.scripts.trial" doesn't have a 'if
|
||||||
# __name__ == "__main__": run()' -style clause). The script name will vary on
|
# __name__ == "__main__": run()' -style clause). The script name will vary on
|
||||||
# the platform.
|
# the platform.
|
||||||
|
|
||||||
|
[testenv:coverage]
|
||||||
|
deps =
|
||||||
|
pyflakes >= 1.2.3
|
||||||
|
mock
|
||||||
|
coverage
|
||||||
|
{env:EXTRA_DEPENDENCY:}
|
||||||
|
commands =
|
||||||
|
pyflakes setup.py src
|
||||||
|
wormhole --version
|
||||||
|
coverage run --branch -m wormhole.test.run_trial {posargs:wormhole}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user