aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/test.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-11-19 20:38:40 +0000
committerPJ Eby <distutils-sig@python.org>2005-11-19 20:38:40 +0000
commit016ae6c42a868bc36c950cd3dc04e75b6ecce7dc (patch)
tree72fb86d76ad349a9a7bff41e2a5caddbccf9df33 /setuptools/command/test.py
parent1c5aaf1332c6c00139883eeffe44c563737176ae (diff)
downloadexternal_python_setuptools-016ae6c42a868bc36c950cd3dc04e75b6ecce7dc.tar.gz
external_python_setuptools-016ae6c42a868bc36c950cd3dc04e75b6ecce7dc.tar.bz2
external_python_setuptools-016ae6c42a868bc36c950cd3dc04e75b6ecce7dc.zip
Added ``tests_require`` keyword to ``setup()``, so that e.g. packages
requiring ``nose`` to run unit tests can make this dependency optional unless the ``test`` command is run. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041483
Diffstat (limited to 'setuptools/command/test.py')
-rw-r--r--setuptools/command/test.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index 200d255d..31f1ae40 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -47,6 +47,9 @@ class test(Command):
self.reinitialize_command('build_ext', inplace=1)
self.run_command('build_ext')
+ if self.distribution.tests_require:
+ self.distribution.fetch_build_eggs(self.distribution.tests_require)
+
if self.test_suite:
cmd = ' '.join(self.test_args)
if self.dry_run:
@@ -55,6 +58,7 @@ class test(Command):
self.announce('running "unittest %s"' % cmd)
self.run_tests()
+
def run_tests(self):
import unittest
old_path = sys.path[:]
@@ -76,7 +80,3 @@ class test(Command):
-
-
-
-