Make sure testvalidateExpirationDateEnforceToFarIntoFuture unit test will fail if no exception is thrown - #34872
Conversation
e86eb62 to
a4acde5
Compare
Codecov Report
@@ Coverage Diff @@
## master #34872 +/- ##
=============================================
- Coverage 65.38% 48.39% -16.99%
=============================================
Files 1213 109 -1104
Lines 70408 10493 -59915
Branches 1295 1280 -15
=============================================
- Hits 46035 5078 -40957
+ Misses 23999 5043 -18956
+ Partials 374 372 -2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #34872 +/- ##
===========================================
+ Coverage 65.37% 65.68% +0.3%
Complexity 18775 18775
===========================================
Files 1222 1222
Lines 70898 70932 +34
Branches 1289 1289
===========================================
+ Hits 46353 46594 +241
+ Misses 24167 23960 -207
Partials 378 378
Continue to review full report at Codecov.
|
|
@phil-davis Do you need some help on this? |
|
@micbar I will look tomorrow. |
558b3a1 to
7dd30a2
Compare
…will fail if no exception is thrown
7dd30a2 to
f88fb63
Compare
|
Backport |
Description
Add a
failin the test path that should not happen. The test is expected to throw an exception, and thecatchblock get executed. Thefailat the end of thetryblock ensures that if the expected exception is not thrown, then the test will fail.Note: the test does go down the correct
catchblock at present, so the test itself does not need changing. I thought that some time in the past the exception was not being thrown, but maybe I was wrong.Related Issue
#34874
Motivation and Context
Remove the possibility of snake-oil tests.
How Has This Been Tested?
404to403and see that the test fails, thus confirming that the code in thecatchblock is really being executed.fail()message happens and the test fails.Types of changes
Checklist:
Open tasks: