]> git.parisson.com Git - telemeta.git/commitdiff
Tests: include py.test support in setup.py
authorThomas Fillon <thomas@parisson.com>
Tue, 18 Nov 2014 16:17:49 +0000 (17:17 +0100)
committerThomas Fillon <thomas@parisson.com>
Tue, 18 Nov 2014 16:17:49 +0000 (17:17 +0100)
.travis.yml
setup.py

index 47c8848aaf5f751e38050b33b73a83d6e0f708d2..412782ca098570d1b837f189ff63c3ad341daba5 100644 (file)
@@ -25,4 +25,4 @@ install:
 before_script:
 - pip install -U pytest-cov pytest-django
 script:
- - py.test -v --cov telemeta
+ - python setup.py test
index 871d62cf9f29e13924946d51c3895cbd54b47757..0830c3361087ef6afb3c5af48a9695271286c69d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,21 @@
 # -*- coding: utf-8 -*-
 from setuptools import setup, find_packages
+from setuptools.command.test import test as TestCommand
 import os
 
+
+class PyTest(TestCommand):
+    def finalize_options(self):
+        TestCommand.finalize_options(self)
+        self.test_args = ['--strict', '--verbose', '--tb=long', 'tests' ,  
+                          '--cov' 'telemeta']
+        self.test_suite = True
+    def run_tests(self):
+        import pytest
+        errno = pytest.main(self.test_args)
+        sys.exit(errno)
+
+
 CLASSIFIERS = ['Environment :: Web Environment',
 'Framework :: Django',
 'Intended Audience :: Science/Research',
@@ -44,6 +58,8 @@ setup(
         'pyyaml',
         'python-ebml',
   ],
+  cmdclass={'test': PyTest},
+  tests_require=['pytest'],
   dependency_links = ['https://github.com/yomguy/django-json-rpc/tarball/0.6.2',
                       'https://github.com/yomguy/django-dynamic-formset/tarball/master',
                       ],