Skip to content

Beginnings of better logging tests.#68

Closed
pp-mo wants to merge 1 commit intotest_logging_plus_BASISfrom
test_logging_plus
Closed

Beginnings of better logging tests.#68
pp-mo wants to merge 1 commit intotest_logging_plus_BASISfrom
test_logging_plus

Conversation

@pp-mo
Copy link
Owner

@pp-mo pp-mo commented Apr 26, 2021

Extends the standard unittest.TestCase.assertLogs method to also exercise the formatting for the messages.

This was in response to problems in Iris testing, see : SciTools#4106

The key problem is that using assertLogs doesn't actually do what the 'real' loggin operation does, so misses code coverage and possible bugs.
I'm still not really convinced that this covers everything that might go wrong in the 'real' logging operation, but I think that it at least helps. It seems that the 'extra format' is perhaps the main configurable part of logger operation, and this exercises the formatter code. What meanwhile might go wrong with any of the attached handlers is not quite so clear : we still aren't exercising those, but if run they would write to files / terminal etc, which we don't want within testing.

@pp-mo pp-mo marked this pull request as draft April 26, 2021 11:52
@pp-mo pp-mo closed this Apr 29, 2021
@pp-mo pp-mo deleted the test_logging_plus branch April 29, 2021 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant