Permalink
Browse files

Added possibility to run tests with 'python setup.py test'

  • Loading branch information...
1 parent a083ec2 commit f5c7726aa59d592b39e4529821c419c4d0eb17a7 @jpvanhal committed Mar 13, 2012
Showing with 17 additions and 5 deletions.
  1. +1 −1 .travis.yml
  2. +16 −4 setup.py
View
@@ -6,4 +6,4 @@ python:
install:
- pip install -q -r dev_requirements.txt --use-mirrors
script:
- - py.test
+ - python setup.py test
View
@@ -1,12 +1,23 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+from setuptools import setup, Command
+import subprocess
import inflection
-try:
- from setuptools import setup
-except ImportError:
- from distutils.core import setup
+
+class PyTest(Command):
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ errno = subprocess.call(['py.test'])
+ raise SystemExit(errno)
setup(
@@ -21,6 +32,7 @@
license=open('LICENSE').read(),
py_modules=['inflection'],
zip_safe=False,
+ cmdclass={'test': PyTest},
classifiers=(
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',

0 comments on commit f5c7726

Please sign in to comment.