tahoe-lafs/src/allmydata/test/run_trial.py
Brian Warner 2e7c7d30c9 run_trial: don't do anything on import
That broke check-interfaces.py, which imports everything.
2016-08-19 17:42:05 -07:00

17 lines
620 B
Python

# 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()