Cleanup @cocotb.test(expect_error=True)
See original GitHub issue#2107 revealed how expect_error=True
can mask a problem, because any Exception
raised by the test will mark it as PASS.
This test passes even though the wrong error is causing the failure:
These tests should be cleaned up to use assert_raises
style or provide the expected Exception
type.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@markusdd There are other uses that should be modified. The test from #2107 is mentioned as the motivating example that showed how using
True
instead of the expectedException
type can lead to an inadvertent PASS. The point of this issue is to investigate the uses ofexpect_error=True
and be more explicit where it makes sense to do so.This test is a duplicate or very similar to what is done in test_handle.py
We agreed to merge/move/remove this in PR #2107