Skip to content

Commit d3c59cb

Browse files
committed
remove version argument
1 parent 9037516 commit d3c59cb

File tree

4 files changed

+1
-27
lines changed

4 files changed

+1
-27
lines changed

setup.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Licensed under the MIT License
22
# https://github.com/craigahobbs/unittest-parallel/blob/main/LICENSE
33

4-
import re
54
import os
65

76
from setuptools import setup
@@ -10,10 +9,6 @@
109
PACKAGE_NAME = 'unittest-parallel'
1110

1211
def main():
13-
# Read the package version
14-
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'src', MODULE_NAME, '__init__.py'), encoding='utf-8') as init_file:
15-
version = re.search(r"__version__ = '(.+?)'", init_file.read()).group(1)
16-
1712
# Read the readme for use as the long description
1813
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md'), encoding='utf-8') as readme_file:
1914
long_description = readme_file.read()
@@ -24,7 +19,7 @@ def main():
2419
description='Parallel unit test runner with coverage support',
2520
long_description=long_description,
2621
long_description_content_type='text/markdown',
27-
version=version,
22+
version='1.4.2',
2823
author='Craig Hobbs',
2924
author_email='craigahobbs@gmail.com',
3025
keywords='test unittest coverage parallel',

src/tests/test_main.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import unittest
88
from unittest.mock import ANY, Mock, call, patch
99

10-
from unittest_parallel import __version__
1110
import unittest_parallel.__main__
1211
from unittest_parallel.main import main
1312

@@ -149,16 +148,6 @@ def assert_output(self, actual, expected):
149148
def test_module_main(self):
150149
self.assertTrue(unittest_parallel.__main__)
151150

152-
def test_version(self):
153-
with patch('sys.stdout', StringIO()) as stdout, \
154-
patch('sys.stderr', StringIO()) as stderr:
155-
with self.assertRaises(SystemExit) as cm_exc:
156-
main(['--version'])
157-
158-
self.assertEqual(cm_exc.exception.code, 0)
159-
self.assertEqual(stdout.getvalue(), '')
160-
self.assertEqual(stderr.getvalue(), str(__version__) + '\n')
161-
162151
def test_jobs(self):
163152
with patch('multiprocessing.cpu_count', Mock(return_value=1)) as cpu_count_mock, \
164153
patch('multiprocessing.Pool', new=MockMultiprocessingPool), \

src/unittest_parallel/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
# Licensed under the MIT License
2-
# https://github.com/craigahobbs/template-specialize/blob/main/LICENSE
3-
4-
__version__ = '1.4.2'

src/unittest_parallel/main.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
import coverage
1515

16-
from . import __version__ as VERSION
17-
1816

1917
def main(argv=None):
2018

@@ -34,8 +32,6 @@ def main(argv=None):
3432
help='One or more TestCase class has a setUpClass method')
3533
parser.add_argument('--module-fixtures', action='store_true', default=False,
3634
help='One or more test module has a setUpModule method')
37-
parser.add_argument('--version', action='store_true',
38-
help='show version number and quit')
3935
group_unittest = parser.add_argument_group('unittest options')
4036
group_unittest.add_argument('-s', '--start-directory', metavar='START', default='.',
4137
help="Directory to start discovery ('.' default)")
@@ -63,8 +59,6 @@ def main(argv=None):
6359
group_coverage.add_argument('--coverage-fail-under', metavar='MIN', type=float,
6460
help='Fail if coverage percentage under min')
6561
args = parser.parse_args(args=argv)
66-
if args.version:
67-
parser.exit(message=VERSION + '\n')
6862
if args.coverage_branch:
6963
args.coverage = args.coverage_branch
7064

0 commit comments

Comments
 (0)