Skip to content

Commit 929448e

Browse files
committed
Revert "fix: remove test command and related code from setup.py"
This reverts commit 9a8366f.
1 parent 9a8366f commit 929448e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

setup.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import sys
1818
import pkg_resources
1919
from setuptools import setup, find_packages
20+
from setuptools.command.test import test as TestCommand
2021

2122
__version__ = '3.20.3'
2223

@@ -35,6 +36,22 @@
3536
with open('requirements-dev.txt', encoding='utf-8') as f:
3637
tests_require = [str(req) for req in pkg_resources.parse_requirements(f)]
3738

39+
40+
class PyTest(TestCommand):
41+
"""PyTest class."""
42+
43+
def finalize_options(self):
44+
TestCommand.finalize_options(self)
45+
self.test_args = ['--strict', '--verbose', '--tb=long', 'test']
46+
self.test_suite = True
47+
48+
def run_tests(self):
49+
import pytest
50+
51+
errcode = pytest.main(self.test_args)
52+
sys.exit(errcode)
53+
54+
3855
with open("README.md", "r", encoding='utf-8') as fh:
3956
readme = fh.read()
4057

@@ -45,6 +62,7 @@
4562
license='Apache 2.0',
4663
install_requires=install_requires,
4764
tests_require=tests_require,
65+
cmdclass={'test': PyTest},
4866
author='IBM',
4967
author_email='[email protected]',
5068
long_description=readme,

0 commit comments

Comments
 (0)