summaryrefslogtreecommitdiff
path: root/src/distutils2/command/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/distutils2/command/test.py')
-rw-r--r--src/distutils2/command/test.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/distutils2/command/test.py b/src/distutils2/command/test.py
index 10c82b6..e6110cb 100644
--- a/src/distutils2/command/test.py
+++ b/src/distutils2/command/test.py
@@ -24,7 +24,7 @@ class test(Command):
if self.distribution.tests_require:
for requirement in self.distribution.tests_require:
if get_distribution(requirement) is None:
- warnings.warn("The test dependency %s is not installed which may couse the tests to fail.",
+ warnings.warn("The test dependency %s is not installed which may couse the tests to fail." % requirement,
RuntimeWarning)
def run(self):
@@ -35,13 +35,14 @@ class test(Command):
build.inplace = 1 # TODO - remove make sure it's needed
self.run_command('build')
os.chdir(self.build_lib)
- args = {"module": self.test_suite,
- "argv": sys.argv[:1]
- }
+ args = {}
if self.test_loader:
loader_class = resolve_name(self.test_loader)
- if loader_class is not None:
- args['testLoader'] = loader_class()
- unittest.main(**args)
+ args['testLoader'] = loader_class()
+ if self.test_suite:
+ argv = [unittest.__file__, '--verbose', self.test_suite]
+ else:
+ argv = [unittest.__file__, '--verbose']
+ unittest.main(None, None, argv, **args)
finally:
os.chdir(prev_cwd)