From 996ff9e51ba2aabf306ecbd021ab191a6fe3df8b Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Tue, 18 Nov 2014 17:17:49 +0100 Subject: [PATCH] Tests: include py.test support in setup.py --- .travis.yml | 2 +- setup.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 47c8848a..412782ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,4 +25,4 @@ install: before_script: - pip install -U pytest-cov pytest-django script: - - py.test -v --cov telemeta + - python setup.py test diff --git a/setup.py b/setup.py index 871d62cf..0830c336 100644 --- 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', ], -- 2.39.5