summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2018-11-15 21:26:15 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2018-11-15 21:26:15 +0300
commit41d3d63758fc3846d5a09afd3b33aac19231942a (patch)
tree7503d6afb5b03514a60592dad45291e24739d61f
parenteff760bd2b79f6db1de00a9d871e45ada673c8fc (diff)
downloadunit-41d3d63758fc3846d5a09afd3b33aac19231942a.tar.gz
unit-41d3d63758fc3846d5a09afd3b33aac19231942a.tar.bz2
Tests: class prefix made optional.
-rw-r--r--test/unit.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/unit.py b/test/unit.py
index 0415d83a..c3efef26 100644
--- a/test/unit.py
+++ b/test/unit.py
@@ -31,10 +31,14 @@ class TestUnit(unittest.TestCase):
TestUnit._set_args(args)
- @staticmethod
- def main():
+ @classmethod
+ def main(cls):
args, rest = TestUnit._parse_args()
+ for i, arg in enumerate(rest):
+ if arg[:5] == 'test_':
+ rest[i] = cls.__name__ + '.' + arg
+
sys.argv = sys.argv[:1] + rest
TestUnit._set_args(args)