From 016ae6c42a868bc36c950cd3dc04e75b6ecce7dc Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Sat, 19 Nov 2005 20:38:40 +0000 Subject: 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 --- setuptools/command/test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'setuptools/command') 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): - - - - -- cgit v1.2.1