summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-06-12 03:45:53 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-06-12 03:45:53 +0200
commit2c2d6c715583f48c7180bfa64447f360c5de8fa3 (patch)
tree9ffb7616a2f490eafc22d46e8c4aa575c1d1e656 /python
parentd14cda0c7c872b20e435b3ed563b4b1215330390 (diff)
downloadsubunit-git-2c2d6c715583f48c7180bfa64447f360c5de8fa3.tar.gz
Move subunitrun => subunit.run
Diffstat (limited to 'python')
-rw-r--r--python/subunit/__init__.py11
-rwxr-xr-xpython/subunit/run.py (renamed from python/subunitrun)29
2 files changed, 21 insertions, 19 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index 23f3f07..7d800a8 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -774,14 +774,3 @@ class TestResultFilter(unittest.TestResult):
return id[len("subunit.RemotedTestCase."):]
return id
-
-class SubunitTestRunner(object):
- def __init__(self, stream=sys.stdout):
- self.stream = stream
-
- def run(self, test):
- "Run the given test case or test suite."
- result = TestProtocolClient(self.stream)
- test(result)
- return result
-
diff --git a/python/subunitrun b/python/subunit/run.py
index a1ec1d9..de15611 100755
--- a/python/subunitrun
+++ b/python/subunit/run.py
@@ -19,14 +19,27 @@
import sys
-from subunit import SubunitTestRunner
-from unittest import TestProgram
-import optparse
-import os
+from subunit import TestProtocolClient
-parser = optparse.OptionParser("subunitrun <tests>")
-args = parser.parse_args()[1]
+class SubunitTestRunner(object):
+ def __init__(self, stream=sys.stdout):
+ self.stream = stream
-runner = SubunitTestRunner()
-program = TestProgram(module=None, argv=[sys.argv[0]] + args, testRunner=runner)
+ def run(self, test):
+ "Run the given test case or test suite."
+ result = TestProtocolClient(self.stream)
+ test(result)
+ return result
+
+
+if __name__ == '__main__':
+ import optparse
+ from unittest import TestProgram
+ parser = optparse.OptionParser("subunitrun <tests>")
+
+ args = parser.parse_args()[1]
+
+ runner = SubunitTestRunner()
+ program = TestProgram(module=None, argv=[sys.argv[0]] + args,
+ testRunner=runner)