summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorphillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771>2008-08-21 21:54:16 +0000
committerphillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771>2008-08-21 21:54:16 +0000
commite03e9ce947a2f81310a3d4dbf2341d596e87359a (patch)
tree68fc262d88cc219e2f90eadf6b5d0e6d38d3417a /setuptools/command
parent71d3cb8ef260dc9162d57742d9a1cf58c0c90e49 (diff)
downloadpython-setuptools-e03e9ce947a2f81310a3d4dbf2341d596e87359a.tar.gz
Added 'test_runner'. (Note: this is a new feature and should not
be backported to the 0.6 branch.) git-svn-id: http://svn.python.org/projects/sandbox/trunk/setuptools@65966 6015fed2-1504-0410-9fe1-9d1591cc4771
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/test.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index db918da..6376873 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -40,7 +40,6 @@ class ScanningLoader(TestLoader):
class test(Command):
-
"""Command to run unit tests after in-place build"""
description = "run unit tests after in-place build"
@@ -49,16 +48,16 @@ class test(Command):
('test-module=','m', "Run 'test_suite' in specified module"),
('test-suite=','s',
"Test suite to run (e.g. 'some_module.test_suite')"),
+ ('test-runner=','r', "Test runner to use"),
]
def initialize_options(self):
+ self.test_runner = None
self.test_suite = None
self.test_module = None
self.test_loader = None
-
def finalize_options(self):
-
if self.test_suite is None:
if self.test_module is None:
self.test_suite = self.distribution.test_suite
@@ -77,7 +76,8 @@ class test(Command):
self.test_loader = getattr(self.distribution,'test_loader',None)
if self.test_loader is None:
self.test_loader = "setuptools.command.test:ScanningLoader"
-
+ if self.test_runner is None:
+ self.test_runner = getattr(self.distribution,'test_runner',None)
def with_project_on_sys_path(self, func):
@@ -125,9 +125,14 @@ class test(Command):
import unittest
loader_ep = EntryPoint.parse("x="+self.test_loader)
loader_class = loader_ep.load(require=False)
+ runner = None
+ if self.test_runner is not None:
+ runner_ep = EntryPoint.parse("x="+self.test_runner)
+ runner_class = runner_ep.load(require=False)
+ runner = runner_class()
unittest.main(
None, None, [unittest.__file__]+self.test_args,
- testLoader = loader_class()
+ testRunner = runner, testLoader = loader_class()
)
@@ -157,8 +162,3 @@ class test(Command):
-
-
-
-
-