Starting a test suite

This commit is contained in:
Andrés Reyes Monge 2013-08-17 10:54:53 -06:00
parent 3691f7f3e6
commit 58d0ea0575
2 changed files with 54 additions and 1 deletions

View file

@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
# Utility function to read the README file.
# Used for the long_description. It's nice, because now
@ -9,6 +11,17 @@ from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(
name='secretary',
version='0.0.1',
@ -24,6 +37,9 @@ setup(
install_requires=[
'Jinja2',
],
tests_require=['pytest'],
cmdclass={'test': PyTest},
test_suite='test_secretary',
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: End Users/Desktop',
@ -33,5 +49,8 @@ setup(
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Office/Business',
'Topic :: Utilities',
]
],
extras_require={
'testing': ['pytest']
}
)