This repository was archived by the owner on Jan 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 11include README.rst LICENSE CONTRIBUTORS.rst HISTORY.rst hyper/certs.pem tox.ini
2-
2+ recursive-include test *
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22# -*- coding: utf-8 -*-
3- import itertools
43import os
54import re
65import sys
76
8- try :
9- from setuptools import setup
10- except ImportError :
11- from distutils .core import setup
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+
1229
1330# Get the version
1431version_regex = r'__version__ = ["\']([^"\']*)["\']'
@@ -83,6 +100,8 @@ def resolve_install_requires():
83100 'Programming Language :: Python :: Implementation :: CPython' ,
84101 ],
85102 install_requires = resolve_install_requires (),
103+ tests_require = ['pytest' , 'requests' , 'mock' ],
104+ cmdclass = {'test' : PyTest },
86105 entry_points = {
87106 'console_scripts' : [
88107 'hyper = hyper.cli:main' ,
You can’t perform that action at this time.
0 commit comments