File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 33 tests/*
44 .tox/*
55 setup.py
6+ *.egg/*
Original file line number Diff line number Diff line change 66import jwt
77
88from setuptools import setup
9+ from setuptools .command .test import test
10+
11+
12+ class PyTest (test ):
13+ user_options = [('pytest-args=' , 'a' , "Arguments to pass to py.test" )]
14+
15+ def initialize_options (self ):
16+ test .initialize_options (self )
17+ self .pytest_args = []
18+
19+ def finalize_options (self ):
20+ test .finalize_options (self )
21+ self .test_args = []
22+ self .test_suite = True
23+
24+ def run_tests (self ):
25+ # import here, cause outside the eggs aren't loaded
26+ import pytest
27+ errno = pytest .main (['.' ] + self .pytest_args )
28+ sys .exit (errno )
929
1030
1131with open (os .path .join (os .path .dirname (__file__ ), 'README.md' )) as readme :
@@ -57,5 +77,7 @@ def get_packages(package):
5777 'Programming Language :: Python :: 3.4' ,
5878 'Topic :: Utilities' ,
5979 ],
60- test_suite = 'tests'
80+ test_suite = 'tests' ,
81+ tests_require = ['pytest' , 'pytest-cov' ],
82+ cmdclass = {'test' : PyTest },
6183)
You can’t perform that action at this time.
0 commit comments