

def test_render_exception(self):
    '\n        Application.render_exception() displays formatted exception.\n        '
    application = Application()
    application.set_auto_exit(False)
    application.get_terminal_width = self.mock().MagicMock(return_value=120)
    tester = ApplicationTester(application)
    tester.run([('command', 'foo')], {
        'decorated': False,
    })
    self.assertEqual(self.open_fixture('application_renderexception1.txt'), tester.get_display())
    tester.run([('command', 'foo')], {
        'decorated': False,
        'verbosity': Output.VERBOSITY_VERBOSE,
    })
    self.assertRegex(tester.get_display(), 'Exception trace')
    tester.run([('command', 'list'), ('--foo', True)], {
        'decorated': False,
    })
    self.assertEqual(self.open_fixture('application_renderexception2.txt'), tester.get_display())
    application.add(Foo3Command())
    tester = ApplicationTester(application)
    tester.run([('command', 'foo3:bar')], {
        'decorated': False,
    })
    self.assertEqual(self.open_fixture('application_renderexception3.txt'), tester.get_display())
    tester = ApplicationTester(application)
    tester.run([('command', 'foo3:bar')], {
        'decorated': True,
    })
    self.assertEqual(self.open_fixture('application_renderexception3decorated.txt'), tester.get_display())
    application = Application()
    tester.set_auto_exit(False)
    application.get_terminal_width = self.mock().MagicMock(return_value=31)
    tester = ApplicationTester(application)
    tester.run([('command', 'foo')], {
        'decorated': False,
    })
    self.assertEqual(self.open_fixture('application_renderexception4.txt'), tester.get_display())

dataset/ETHPy150Open sdispater/cleo/tests/test_application.py ApplicationTest.test_render_exception/VarMisuse@286/418 `application`->`tester`