Skip to content

Conversation

@jayvdb
Copy link
Contributor

@jayvdb jayvdb commented Sep 24, 2020

No description provided.

def testOverflowError(self):
# For really big lists, we can't use the len() function any more
with self.assertRaises(OverflowError):
with self.assertRaises(OverflowError) as cm:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertRaisesRegex can do the message check in one line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the message strings are long, the single line syntax doesnt fit in a single line - and can look quite messy in a with.

Also the messages often change over time, while the Exception subclass and trigger logic usually does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants