Skip to content

[6/8] Use assert(Not)Regex instead of assertTrue or assertFalse in tests - #5245

Merged
akesandgren merged 3 commits into
easybuilders:developfrom
Flamefire:assertregex-6
Sep 17, 2026
Merged

akesandgren merged 3 commits into
easybuilders:developfrom
Flamefire:assertregex-6

Conversation

@Flamefire

Copy link
Copy Markdown
Contributor

This makes the tests shorter and hence easier to read, avoids re.compile calls and manual failure message composing. In some cases assert_multi_regex could be used to avoid the explicit loops.

@Flamefire Flamefire changed the title [6/8] Use assert(Not)Regex instead of assertTrue or assertFalse [6/8] Use assert(Not)Regex instead of assertTrue or assertFalse in tests Aug 26, 2026
@boegel boegel added the tests label Sep 4, 2026
… in tests

This makes the tests shorter and hence easier to read, avoids
`re.compile` calls and manual failure message composing.
In some cases `assert_multi_regex` could be used to avoid the explicit loops.
Comment thread test/framework/docs.py Outdated
Comment thread test/framework/docs.py Outdated
@Flamefire

Copy link
Copy Markdown
Contributor Author

@akesandgren I searched for other occurrences where assert(Not)In can be used and fixed them (hopefully) all in the new commit

@akesandgren akesandgren left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@akesandgren akesandgren added this to the next release (5.4.1) milestone Sep 17, 2026
@akesandgren

Copy link
Copy Markdown
Contributor

Going in, thanks @Flamefire!

@akesandgren
akesandgren merged commit 46c7829 into easybuilders:develop Sep 17, 2026
41 checks passed
@Flamefire
Flamefire deleted the assertregex-6 branch September 17, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants