def test_log_error(self, bright_mock, red_mock, reset_mock, stdout_mock): bright_mock.__str__.return_value = '@' red_mock.__str__.return_value = '<|||>' reset_mock.__str__.return_value = '__R__' cli.log_error('mystr') stdout_mock.assert_called_once_with('@<|||>ERROR__R__: mystr\n')
def main(): '''The entry point for Setuptools.''' from radon.cli import program, log_error try: program() except Exception as e: log_error(e)
def main(): """The entry point for Setuptools.""" from radon.cli import BAKER, log_error try: BAKER.run() except Exception as e: log_error(e) raise
def main(): '''The entry point for Setuptools.''' import sys from radon.cli import program, log_error if not sys.argv[1:]: sys.argv.append('-h') try: program() except Exception as e: log_error(e)
def test_log_error(mocker, stdout_mock): reset_mock = mocker.patch('radon.cli.RESET') red_mock = mocker.patch('radon.cli.RED') bright_mock = mocker.patch('radon.cli.BRIGHT') bright_mock.__str__.return_value = '@' red_mock.__str__.return_value = '<|||>' reset_mock.__str__.return_value = '__R__' cli.log_error('mystr') stdout_mock.assert_called_once_with('@<|||>ERROR__R__: mystr\n')