Skip to content

Commit e5d60b2

Browse files
committed
Cleanup error messages on failure
When test_server_commands_main_help() fails it dumps a ton of unformatted text on an exception message. This commit attempts to clean it up to make it easier to read. Change-Id: I793e6337728a22302a5a87938dbec60d7f2320d8
1 parent c24451e commit e5d60b2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

openstackclient/tests/functional/common/test_help.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ def test_server_commands_main_help(self):
6060
"""Check server commands in main help message."""
6161
raw_output = self.openstack('help')
6262
for command, description in self.SERVER_COMMANDS:
63-
self.assertIn(command, raw_output)
64-
self.assertIn(description, raw_output)
63+
msg = 'Command: %s not found in help output:\n%s' % (
64+
command, raw_output)
65+
self.assertIn(command, raw_output, msg)
66+
msg = 'Description: %s not found in help output:\n%s' % (
67+
description, raw_output)
68+
self.assertIn(description, raw_output, msg)
6569

6670
def test_server_only_help(self):
6771
"""Check list of server-related commands only."""

0 commit comments

Comments
 (0)