|
There is a newer version available. For the latest stable version, please use nvda-addon-testkit 2.x! |
nvda.log
Structured log records, and assert_no_errors() for the common case of "my add-on shouldn’t
have logged anything alarming."
def test_the_installed_addon_logs_at_startup(nvda, addon_under_test):
nvda.restart()
nvda.log.wait_for(re.escape(STARTUP_MESSAGE), since=0, timeout=20)
wait_for takes a regex and an index to search from — pass since=0 (as above) to search the
whole session, or since=nvda.log.index() taken earlier to ignore anything logged before that
point.
errors() and warnings() filter by level; assert_no_errors() raises with the offending
records attached instead of returning a bare False.