Commit 8b714dc7 authored by Jason R. Coombs's avatar Jason R. Coombs

Apply patch based on patch in 2008 by Klaus Zimmerman. Fixes #176.

parent 0873d471
......@@ -9,6 +9,8 @@ CHANGES
* Issue #97: Added experimental support for PEP 420 namespace package
discovery via the ``PEP420PackageFinder.find`` method. This new method will
discover packages for directories lacking an __init__.py module.
* Issue #176: Add parameter to the test command to support a custom test
runner: --test-runner or -r.
---
3.3
......
......@@ -152,6 +152,7 @@ setup_params = dict(
"packages = setuptools.dist:check_packages",
"dependency_links = setuptools.dist:assert_string_list",
"test_loader = setuptools.dist:check_importable",
"test_runner = setuptools.dist:check_importable",
"use_2to3 = setuptools.dist:assert_bool",
"convert_2to3_doctests = setuptools.dist:assert_string_list",
"use_2to3_fixers = setuptools.dist:assert_string_list",
......
......@@ -51,12 +51,14 @@ 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_suite = None
self.test_module = None
self.test_loader = None
self.test_runner = None
def finalize_options(self):
......@@ -78,6 +80,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):
if sys.version_info >= (3,) and getattr(self.distribution, 'use_2to3', False):
......@@ -154,8 +158,10 @@ class test(Command):
loader_ep = EntryPoint.parse("x="+self.test_loader)
loader_class = loader_ep.load(require=False)
cks = loader_class()
runner_ep = EntryPoint.parse("x=" + self.test_runner)
runner_class = runner_ep.load(require=False)
unittest.main(
None, None, [unittest.__file__]+self.test_args,
testLoader = cks
testLoader=loader_class(),
testRunner=runner_class(),
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment