From afe0be4c70860e30a71fa9046f3ba8c052ab6a87 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Fri, 4 May 2018 07:29:12 +0700 Subject: [PATCH] setup.py: Sync moban Related to https://gitlab.com/coala/mobans/merge_requests/3 --- setup.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c0a71ebdf6..b181fb434f 100755 --- a/setup.py +++ b/setup.py @@ -21,11 +21,24 @@ class PyTestCommand(TestCommand): + """ + From https://pytest.org/latest/goodpractices.html + """ + user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')] + + def initialize_options(self): + TestCommand.initialize_options(self) + self.pytest_args = [] + + def finalize_options(self): + TestCommand.finalize_options(self) + self.test_args = [] + self.test_suite = True def run_tests(self): # import here, cause outside the eggs aren't loaded import pytest - errno = pytest.main([]) + errno = pytest.main(self.pytest_args) sys.exit(errno)