def run(self):
import pytest
import _pytest.main
# Customize messages for pytest exit codes...
msg = {_pytest.main.EXIT_OK: 'OK',
_pytest.main.EXIT_TESTSFAILED: 'Tests failed',
_pytest.main.EXIT_INTERRUPTED: 'Interrupted',
_pytest.main.EXIT_INTERNALERROR: 'Internal error',
_pytest.main.EXIT_USAGEERROR: 'Usage error',
_pytest.main.EXIT_NOTESTSCOLLECTED: 'No tests collected'}
bldobj = self.distribution.get_command_obj('build')
bldobj.run()
exitcode = pytest.main(self.pytest_opts)
print(msg[exitcode])
sys.exit(exitcode)
评论列表
文章目录