From 71f34e4f5bcd7202b048a86863f94f91bb9faf34 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 22 Feb 2017 18:03:33 -0800 Subject: [PATCH] test/run_trial.py: protect run() with __name__ Without this, any import (e.g. when running "automat-visualize") caused the tests to be run as a side-effect. --- src/wormhole/test/run_trial.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wormhole/test/run_trial.py b/src/wormhole/test/run_trial.py index 9b58cfa..1c9ffee 100644 --- a/src/wormhole/test/run_trial.py +++ b/src/wormhole/test/run_trial.py @@ -11,6 +11,6 @@ from __future__ import unicode_literals # So use: # "coverage run -m wormhole.test.run_trial ARGS" -from twisted.scripts.trial import run - -run() +if __name__ == "__main__": + from twisted.scripts.trial import run + run()