summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2013-03-03 17:51:49 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-03-03 21:38:46 +0100
commit050af55b77372b39fb6efecfb93bb6ee8ee425ed (patch)
treea9935cbe20f0482035526402b4f56cf68c735cf2
parent197e47a469b99595d992a51fbd48df0cd85532da (diff)
downloadfactory-boy-050af55b77372b39fb6efecfb93bb6ee8ee425ed.tar
factory-boy-050af55b77372b39fb6efecfb93bb6ee8ee425ed.tar.gz
Improve testing helpers.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
-rw-r--r--Makefile1
-rwxr-xr-xsetup.py9
2 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 144c2e9..f9c27c0 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,6 @@ coverage:
coverage report "--include=factory/*.py,tests/*.py"
coverage html "--include=factory/*.py,tests/*.py"
-
doc:
$(MAKE) -C docs html
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():