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 5
5
import sys
6
6
7
7
from 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
+
8
29
9
30
# Get the version
10
31
version_regex = r'__version__ = ["\']([^"\']*)["\']'
@@ -79,6 +100,8 @@ def resolve_install_requires():
79
100
'Programming Language :: Python :: Implementation :: CPython' ,
80
101
],
81
102
install_requires = resolve_install_requires (),
103
+ tests_require = ['pytest' , 'requests' , 'mock' ],
104
+ cmdclass = {'test' : PyTest },
82
105
entry_points = {
83
106
'console_scripts' : [
84
107
'hyper = hyper.cli:main' ,
You can’t perform that action at this time.
0 commit comments