aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/test.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2006-03-29 23:32:41 +0000
committerPJ Eby <distutils-sig@python.org>2006-03-29 23:32:41 +0000
commit696739a1fc24ccb3ace56a2156b7199f6b85e194 (patch)
tree03c589abad3b004b2f73605057cb3e2aaae7b345 /setuptools/command/test.py
parentf4505e41e7c3c4c270c53a4506b3f17556f20f76 (diff)
downloadexternal_python_setuptools-696739a1fc24ccb3ace56a2156b7199f6b85e194.tar.gz
external_python_setuptools-696739a1fc24ccb3ace56a2156b7199f6b85e194.tar.bz2
external_python_setuptools-696739a1fc24ccb3ace56a2156b7199f6b85e194.zip
Added ``test_loader`` keyword to support custom test loaders.
--HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4043430
Diffstat (limited to 'setuptools/command/test.py')
-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 0370e372..83589fa9 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -51,11 +51,10 @@ class test(Command):
"Test suite to run (e.g. 'some_module.test_suite')"),
]
- test_suite = None
- test_module = None
-
def initialize_options(self):
- pass
+ self.test_suite = None
+ self.test_module = None
+ self.test_loader = None
def finalize_options(self):
@@ -74,9 +73,10 @@ class test(Command):
if self.verbose:
self.test_args.insert(0,'--verbose')
-
-
-
+ if self.test_loader is None:
+ self.test_loader = getattr(self.distribution,'test_loader',None)
+ if self.test_loader is None:
+ self.test_loader = "setuptools.command.test:ScanningLoader"
@@ -111,13 +111,13 @@ class test(Command):
dist = Distribution(path_item, metadata, project_name=ei_cmd.egg_name)
working_set.add(dist)
require(str(dist.as_requirement()))
+ loader_ep = EntryPoint.parse("x="+self.test_loader)
+ loader_class = loader_ep.load(require=False)
unittest.main(
None, None, [unittest.__file__]+self.test_args,
- testLoader = ScanningLoader()
+ testLoader = loader_class()
)
-
-