summaryrefslogtreecommitdiffhomepage
path: root/test/run.py
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2020-02-06 18:25:25 +0300
committerAndrei Belov <defan@nginx.com>2020-02-06 18:25:25 +0300
commit2dc01938cf02cc05b41a09e618f712129c4cdf91 (patch)
tree556dd40a0ec8c194774d53eed9ff62ed1d25ee7c /test/run.py
parent477a58e14010ab14d6ab453860b360cf806f5012 (diff)
parent6e19090736612b39d4c5d0836d7df0722b8955e7 (diff)
downloadunit-2dc01938cf02cc05b41a09e618f712129c4cdf91.tar.gz
unit-2dc01938cf02cc05b41a09e618f712129c4cdf91.tar.bz2
Merged with the default branch.1.15.0-1
Diffstat (limited to '')
-rwxr-xr-xtest/run.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/run.py b/test/run.py
index 0504a6f7..b79d0484 100755
--- a/test/run.py
+++ b/test/run.py
@@ -4,16 +4,17 @@ import unittest
import sys
import os
-loader = unittest.TestLoader()
-suite = unittest.TestSuite()
+if __name__ == '__main__':
+ loader = unittest.TestLoader()
+ suite = unittest.TestSuite()
-this_dir = os.path.dirname(__file__)
-tests = loader.discover(start_dir=this_dir)
-suite.addTests(tests)
+ this_dir = os.path.dirname(__file__)
+ tests = loader.discover(start_dir=this_dir)
+ suite.addTests(tests)
-runner = unittest.TextTestRunner(verbosity=3)
-result = runner.run(suite)
+ runner = unittest.TextTestRunner(verbosity=3)
+ result = runner.run(suite)
-ret = not (len(result.failures) == len(result.errors) == 0)
+ ret = not (len(result.failures) == len(result.errors) == 0)
-sys.exit(ret)
+ sys.exit(ret)