Skip to content

Conversation

Flamefire
Copy link
Contributor

We no longer need this custom function with Python 2 support being dropped.

The only remaining use case was EasyBuildError where str(e) didn't return the error as a string but as an escaped string.

See also #5009 which fixes that (single relevant commit included here to avoid test failures)

This makes it easier to use, especially for new devs being used to the unittest module and conventions for other functions like self.assertRaises.

Additionally this can be used as a context manager:

with self.assertRaises(TypeError): # similar for assertRaisesRegex
  do_this()
  do_that()

@Flamefire Flamefire force-pushed the replace-assertErrorRegex branch 2 times, most recently from 362f231 to 6d93182 Compare September 29, 2025 08:33
@Flamefire Flamefire force-pushed the replace-assertErrorRegex branch from 6d93182 to 35125ac Compare September 29, 2025 10:35
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.

1 participant