Allow CheckerTestCase to assertDoesNotAddMessages() to check that a specific message has not been added #9598
Labels
Enhancement ✨
Improvement to a component
Good first issue
Friendly and approachable by new contributors
Help wanted 🙏
Outside help would be appreciated, good for new contributors
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Current problem
I use
CheckerTestCase
in tests for linting scripts in a project. There are some tests where I want to assert that a specific message has not been added given a specific code snippet. WhileassertNoMessages()
works for now, it is possible in the future that I want to assert that a different message occurs for the same code snippet.assertNoMessages()
wouldn't work because we do want to check that the different message has been added, but replacingassertNoMessages()
withassertAddsMessages(different_message, ...)
would mean that we can no longer check that the original message is not being added.Desired solution
If I could directly assert that a specific message has not been added, then I could have more control over which specific messages I'd want or would not want under various scenarios. For my given example, something like this:
Better represents which messages I want to occur and which messages I want to not occur.
Additional context
No response
The text was updated successfully, but these errors were encountered: