I'm trying to add pylint
checking of all .py
files to the test
process of setuptools (maybe I'm doing something wrong, please correct me). This is what I'm doing in setup.py
:
class MyTest(test):
def run_tests(self):
import pytest
import pylint
if (pylint.run_pylint()):
sys.exit(-1)
if (pytest.main(self.test_args)):
sys.exit(-1)
setup(
tests_require = ['pytest', 'pylint'],
cmdclass = {'test': MyTest},
...
)
When I run python setup.py test
the output looks broken.. Am I doing it right?
Configuration working for me: In setup.py:
setup(
name='...',
setup_requires=['pytest-runner', 'pytest-pylint', ...],
tests_require=['pytest', 'pylint']
...
)
In setup.cfg:
[aliases]
test=pytest
[pytest]
addopts = --pylint --pylint-rcfile=...
Then you can run pylint just by typing:
python setup.py test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With