Skip to content

Commit 0a858db

Browse files
author
pgaref
committed
Adding tox as the default test runner
1 parent bf4b212 commit 0a858db

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

setup.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ def read(*parts):
1818
# LONG_DESCRIPTION = read('README.md')
1919

2020

21+
class Tox(TestCommand):
22+
def finalize_options(self):
23+
TestCommand.finalize_options(self)
24+
self.test_args = []
25+
self.test_suite = True
26+
27+
def run_tests(self):
28+
#import here, cause outside the eggs aren't loaded
29+
import tox
30+
errcode = tox.cmdline(self.test_args)
31+
sys.exit(errcode)
32+
33+
2134
class PyTest(TestCommand):
2235
def finalize_options(self):
2336
TestCommand.finalize_options(self)
@@ -44,11 +57,13 @@ def run_tests(self):
4457
description='A package using public proxies to randomise http requests.',
4558
# long_description=LONG_DESCRIPTION,
4659
packages=find_packages(exclude=['tests']),
47-
cmdclass={'test': PyTest},
48-
test_suite='tests.test_parsers',
4960
include_package_data=True,
5061
platforms='any',
51-
tests_require=['pytest', 'pytest-cov'],
62+
test_suite='tests.test_parsers',
63+
tests_require=['tox'],
64+
cmdclass={'test': Tox},
65+
# tests_require=['pytest', 'pytest-cov'],
66+
# cmdclass={'test': PyTest},
5267
install_requires=['beautifulsoup4 >= 4.5.3',
5368
'httmock>=1.2.6',
5469
'psutil>=5.1.3',

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py27verbose, py3verbose
7+
envlist = py27, py3
88

99
[testenv]
1010
;commands = {envpython} setup.py test

0 commit comments

Comments
 (0)