Permalink
Browse files

Added a setup test command

  • Loading branch information...
1 parent 29fcf25 commit 87df59a79cd2bff3253ad8c25ec4f177b2f715b2 @charettes committed Jan 26, 2013
Showing with 20 additions and 1 deletion.
  1. +20 −1 setup.py
View
@@ -1,17 +1,34 @@
#!/usr/bin/env python
import os
import re
-from setuptools import setup, find_packages
+from setuptools import Command, find_packages, setup
+from subprocess import call
from mutant import __version__
MODULE_PATH = os.path.abspath(os.path.dirname(__file__))
+
+class TestCommand(Command):
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ call(['django-admin.py', 'test', '--pythonpath', MODULE_PATH,
+ '--settings', 'tests.test_sqlite'])
+
+
LINK_REQUIREMENT = re.compile(
r'^https://.+#egg=(?P<package>.+)-(?P<version>\d(?:\.\d)*)$'
)
+
install_requires = ['django>=1.4']
dependency_links = []
@@ -23,6 +40,7 @@
else:
install_requires.append(requirement)
+
setup(
name='django-mutant',
version='.'.join(str(v) for v in __version__),
@@ -46,4 +64,5 @@
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
],
+ cmdclass={'test': TestCommand}
)

0 comments on commit 87df59a

Please sign in to comment.