From 050af55b77372b39fb6efecfb93bb6ee8ee425ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Sun, 3 Mar 2013 17:51:49 +0100 Subject: Improve testing helpers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaƫl Barrois --- setup.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 57e701e..ef3da96 100755 --- a/setup.py +++ b/setup.py @@ -51,7 +51,14 @@ class test(cmd.Command): else: verbosity=0 - suite = unittest.TestLoader().loadTestsFromName(self.test_suite) + loader = unittest.TestLoader() + suite = unittest.TestSuite() + + if self.test_suite == 'tests': + for test_module in loader.discover('.'): + suite.addTest(test_module) + else: + suite.addTest(loader.loadTestsFromName(self.test_suite)) result = unittest.TextTestRunner(verbosity=verbosity).run(suite) if not result.wasSuccessful(): -- cgit v1.2.3