-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better handling of file loggers in testing #332
Better handling of file loggers in testing #332
Conversation
Not quite sure why the Windows builds are failing - something to do with the paths in the logger testing. The underlying problem seems to be a permissions problem with shutting down a |
Codecov Report
@@ Coverage Diff @@
## develop #332 +/- ##
===========================================
- Coverage 96.43% 96.26% -0.17%
===========================================
Files 48 51 +3
Lines 2440 2491 +51
===========================================
+ Hits 2353 2398 +45
- Misses 87 93 +6
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No - apparently I can't read the error log. It is something to do with exiting the |
tly - cleanly close the file logger from inside with blocks as well as on test failures
…-logger-output-to-fail
Description
This PR:
virtual_rainforest.core.logger.add_file_logger
andvirtual_rainforest.core.logger.remove_file_logger
to cope with repeated calls to the same function. You cannot add a file handler twice, but removing a non-existent file handler now just exits cleanly.test_vr_run
issue fromtest_vr_run
failing all unit tests of logger output to fail #331 to add general exception handling to remove the file handler if things go wrong and also to test that the requested log file is populated.Fixes #331
Type of change
Key checklist
pre-commit
checks:$ pre-commit run -a
$ poetry run pytest
Further checks