test: refactor test_reporting.py to use only pytest#6449
Conversation
|
@aciba90 Please kindly review |
aciba90
left a comment
There was a problem hiding this comment.
Thanks @chijioke-ibekwe for the refactoring, it looks good.
I left an inline request and I think the commit related to test_data.py might be for other PR as it is not reference in the PR comment, or is it intended to be included?
| getattr(events.status, "BOGUS") | ||
|
|
||
|
|
||
| @skipUnlessJsonSchema() |
There was a problem hiding this comment.
This is need for environments where jsonschema is not installed, could you please bring it back?
There was a problem hiding this comment.
Are these modifications intended for this PR?
There was a problem hiding this comment.
These were from the previous PR. Not sure why it's still when it's already been merged to main. Should I create a new branch for this?
There was a problem hiding this comment.
One way to fix it is to do git rebase -i main and drop the unwanted commit. Or a new branch and cherry-pick the top commit from here. Whatever works for you, thanks!
| def test_base_reporting_handler_is_abstract(self): | ||
| regexp = r".*abstract.*publish_event.*" | ||
| self.assertRaisesRegex(TypeError, regexp, handlers.ReportingHandler) | ||
| with pytest.raises(TypeError, match=r".*abstract.*publish_event.*"): |
There was a problem hiding this comment.
This test tests that ReportingHandler is an abstract class, mypy complains about instantiating an abstract class.
Honestly, I think this test doesn't add much value and I suggest removing it.
There was a problem hiding this comment.
This is noted
…base_reporting_handler_is_abstract test
522e47b to
d99ec43
Compare
|
@aciba90 Kindly re-review |
Remove helpers.TestCase inheritance, replace unittest assertions with pytest equivalents, and rename helper methods using pytest naming convention. This change is a refactor only. Test behavior and coverage remains exactly the same. canonicalGH-6427
Remove helpers.TestCase inheritance, replace unittest assertions with pytest equivalents, and rename helper methods using pytest naming convention. This change is a refactor only. Test behavior and coverage remains exactly the same. canonicalGH-6427
Proposed Commit Message
Additional Context
Test Steps
Merge type