-
Notifications
You must be signed in to change notification settings - Fork 12
Show filename from OSError when relevant #72
Conversation
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
+ Coverage 91.56% 92.08% +0.52%
==========================================
Files 21 21
Lines 2003 2010 +7
Branches 427 429 +2
==========================================
+ Hits 1834 1851 +17
+ Misses 110 101 -9
+ Partials 59 58 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
|
The only thing I can think to do for the coverage complaint is to mock out I can do that if you want, or slap a |
|
I've now added a test case that mocks a BTW I am so glad that your unit tests are not the style that mocks literally everything but a single function/method under test. Mocks are great for situations like this case, but I've seen people overdo it to the point that their tests are like 80% mock configuration that has to change at the slightest refactoring. |
|
@marksparkza this short PR shares a test fixture commit with #71, so you probably want to merge this before doing anything complicated with #71's branch. I can rebase #71 if needed. |
For incomprehensible reasons apparently having to do with backwards compatibility, the filename parameter to OSError is not part of the 'args' member, so the exception handling code that uses 'args' to convert to a CatalogError was dropping the rather important filename from the FileNotFound error.
Mock open() to simulate a non-file IOError.
For incomprehensible reasons apparently having to do with backwards compatibility, the filename parameter to
OSErroris not part of theargsmember, so the exception handling code that usesargsto convert to aCatalogErrorwas dropping the rather important filename from theFileNotFounderror.Note that this PR shares the fixture commit with PR #71