diff options
author | Mikhail Korobov <kmike84@gmail.com> | 2012-04-10 10:58:14 +0600 |
---|---|---|
committer | Mikhail Korobov <kmike84@gmail.com> | 2012-04-10 10:58:14 +0600 |
commit | af00973f82337a24aeececa2244ea3fc532db6d2 (patch) | |
tree | 8fb43d6b3fc60f5d651e0490b5f16219d5337cb1 /setup.py | |
parent | e80cbdc3224297ee57667e4000f1a671af05f520 (diff) | |
download | factory-boy-af00973f82337a24aeececa2244ea3fc532db6d2.tar factory-boy-af00973f82337a24aeececa2244ea3fc532db6d2.tar.gz |
Test running improvements: tests can be run under python 2.6 (by using optional unittest2), tox config for testing under different pythons, explicit python version requirements (factory_boy works with python 2.6 and 2.7); ./setup.py test returns proper error code in case of test failure.
Diffstat (limited to 'setup.py')
-rwxr-xr-x[-rw-r--r--] | setup.py | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1,6 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +import sys from distutils.core import setup from distutils import cmd @@ -26,7 +27,11 @@ class test(cmd.Command): def run(self): """Run the test suite.""" - import unittest + try: + import unittest2 as unittest + except ImportError: + import unittest + if self.verbose: verbosity=1 else: @@ -34,7 +39,9 @@ class test(cmd.Command): suite = unittest.TestLoader().loadTestsFromName(self.test_suite) - unittest.TextTestRunner(verbosity=verbosity).run(suite) + result = unittest.TextTestRunner(verbosity=verbosity).run(suite) + if (not result.wasSuccessful()): + sys.exit(1) setup( @@ -45,7 +52,7 @@ setup( author_email='mark@deliciouslynerdy.com', maintainer='Raphaƫl Barrois', maintainer_email='raphael.barrois@polytechnique.org', - url='http://github.com/rbarrois/factory_boy', + url='https://github.com/rbarrois/factory_boy', keywords=['factory_boy', 'factory', 'fixtures'], packages=['factory'], license='MIT', @@ -56,6 +63,9 @@ setup( 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Testing', 'Topic :: Software Development :: Libraries :: Python Modules' ], |