|
8 | 8 | from codecs import open |
9 | 9 |
|
10 | 10 | from setuptools import find_packages, setup |
11 | | -from setuptools.command.test import test as test_command |
| 11 | +from bernardomg.tox_test_command import ToxTestCommand |
12 | 12 |
|
13 | 13 | """ |
14 | 14 | PyPI configuration module. |
@@ -43,41 +43,6 @@ def read(*names, **kwargs): |
43 | 43 | version_lib = str(ast.literal_eval(version_lib.rstrip())) |
44 | 44 |
|
45 | 45 |
|
46 | | -class _ToxTester(test_command): |
47 | | - """ |
48 | | - Tox test command. |
49 | | -
|
50 | | - Calls tox for running the tests. |
51 | | - """ |
52 | | - user_options = [ |
53 | | - ('test-module=', 'm', "Run 'test_suite' in specified module"), |
54 | | - ('test-suite=', 's', |
55 | | - "Run single test, case or suite (e.g. 'module.test_suite')"), |
56 | | - ('test-runner=', 'r', "Test runner to use"), |
57 | | - ('profile=', 'p', 'Test profile to use') |
58 | | - ] |
59 | | - |
60 | | - def initialize_options(self): |
61 | | - test_command.initialize_options(self) |
62 | | - self.profile = None |
63 | | - |
64 | | - def finalize_options(self): |
65 | | - test_command.finalize_options(self) |
66 | | - self.test_args = [] |
67 | | - |
68 | | - if self.profile is not None: |
69 | | - # Adds the profile argument |
70 | | - # For example: '-e=py36' |
71 | | - self.test_args.append('-e=' + self.profile) |
72 | | - |
73 | | - def run_tests(self): |
74 | | - # import here, cause outside the eggs aren't loaded |
75 | | - import tox |
76 | | - |
77 | | - errcode = tox.cmdline(self.test_args) |
78 | | - sys.exit(errcode) |
79 | | - |
80 | | - |
81 | 46 | setup( |
82 | 47 | name='dice-notation', |
83 | 48 | packages=find_packages(), |
@@ -111,6 +76,6 @@ def run_tests(self): |
111 | 76 | tests_require=_tests_require, |
112 | 77 | extras_require={'test': _tests_require}, |
113 | 78 | cmdclass={ |
114 | | - 'test': _ToxTester |
| 79 | + 'test': ToxTestCommand |
115 | 80 | }, |
116 | 81 | ) |
0 commit comments