Why test with exception in test_import?
See original GitHub issueI was checking for coverage and I saw this test
import alchemlyb
def test_name():
try:
assert alchemlyb.__name__ == 'alchemlyb'
except Exception as e:
raise e
Why are we catching an Exception here in a test?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How do you assert that a certain exception is thrown in JUnit ...
Using ExpectedException you can only test that one method throws an exception, because when that method is called, the test will stop executing...
Read more >Asserting exceptions in JUnit - cassiomolin
This post explores some techniques for asserting exceptions in Java ... Test; import static org.hamcrest. ... Test; import org.junit.rules.
Read more >JUnit - Expected Exceptions Test - Mkyong.com
In JUnit, there are 3 ways to test the expected exceptions : @Test , optional 'expected' attribute; Try-catch and always fail() ...
Read more >JUnit Assert Exception - JUnit 5 and JUnit 4 - DigitalOcean
We can test expected exceptions using JUnit 5 assertThrows assertion. ... Test; import org.junit.rules.ExpectedException; public class ...
Read more >JUnit Exception Testing - Memorynotfound
JUnit provides us with a basic toolkit to verify if an exception is thrown. There are some differences in how we can check...
Read more >
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 Free
Top 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
I didn’t know about “blame” 😃
It seems @ianmkenney did the commit 6 years ago! Could we just remove the
try
?Great, I implemented the change in PR #240, I hope it’s fine, just not to have another PR just for that!