This repository was archived by the owner on Jan 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 55import sys
66
77from setuptools import setup
8+ from setuptools .command .test import test as TestCommand
9+
10+
11+ class PyTest (TestCommand ):
12+ user_options = [('pytest-args=' , 'a' , "Arguments to pass to py.test" )]
13+
14+ def initialize_options (self ):
15+ TestCommand .initialize_options (self )
16+ self .pytest_args = ['test/' ]
17+
18+ def finalize_options (self ):
19+ TestCommand .finalize_options (self )
20+ self .test_args = []
21+ self .test_suite = True
22+
23+ def run_tests (self ):
24+ # import here, cause outside the eggs aren't loaded
25+ import pytest
26+ errno = pytest .main (self .pytest_args )
27+ sys .exit (errno )
28+
829
930# Get the version
1031version_regex = r'__version__ = ["\']([^"\']*)["\']'
@@ -79,6 +100,8 @@ def resolve_install_requires():
79100 'Programming Language :: Python :: Implementation :: CPython' ,
80101 ],
81102 install_requires = resolve_install_requires (),
103+ tests_require = ['pytest' , 'requests' , 'mock' ],
104+ cmdclass = {'test' : PyTest },
82105 entry_points = {
83106 'console_scripts' : [
84107 'hyper = hyper.cli:main' ,
You can’t perform that action at this time.
0 commit comments