Merge pull request #454 from tpltnt/ticket-2811

coverage: replace run_trial with "python -m twisted.trial"
This commit is contained in:
meejah 2018-01-04 14:54:05 -07:00 committed by GitHub
commit 139d63df64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 18 deletions

View File

@ -73,7 +73,9 @@ install_requires = [
# * Twisted-16.1.0 fixes https://twistedmatrix.com/trac/ticket/8223,
# which otherwise causes test_system to fail (DirtyReactorError, due to
# leftover timers)
"Twisted[tls] >= 16.1.0",
# * Twisted-16.4.0 instroduces twisted.trial which is needed for coverage
# testing
"Twisted[tls] >= 16.4.0",
# We need Nevow >= 0.11.1 which can be installed using pip.
"Nevow >= 0.11.1",

View File

@ -1,16 +0,0 @@
# This is a tiny helper module, to let "python -m allmydata.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 allmydata.test.run_trial ARGS"
if __name__ == "__main__":
from twisted.scripts.trial import run
run()

View File

@ -30,7 +30,7 @@ deps = --editable=.[test]
commands =
pyflakes src static misc setup.py
tahoe --version
coverage run --branch -m allmydata.test.run_trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors --reporter=timing} {posargs:allmydata}
coverage run --branch -m twisted.trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors --reporter=timing} {posargs:allmydata}
coverage xml
[testenv:codechecks]