adding latest

This commit is contained in:
2021-10-30 23:39:52 +01:00
parent 3f939bc5a9
commit 413f783475
5 changed files with 45 additions and 16 deletions

View File

@@ -20,6 +20,22 @@ Documentation:
☐ Document how to use pytest to read a logging message
<https://stackoverflow.com/questions/53125305/testing-logging-output-with-pytest>
- caplog as fixture
- reading `caplog.records[0].message`
see `_old_test_pages.py`
☐ Document testing value of an exception raised
When you use `with pytest.raises` you can use `.value` to access the attributes
reading `.value.code`
reading `str(.value)`
☐ Document working with exceptions
☐ General pattern - raise exceptions in codebase, catch them in the CLI.
Allows people to use via an API and handle the exceptions themselves.
You can use python builtins but custom exceptions are better for internal control
☐ Capturing exceptions in the CLI.
Access the message of the exception with `.args[0]`.
use `raise SystemExit(1) from exception` in order to gracefully exit
☐ Document using datadir with a module rather than a shared one. Link to tembo as an example.
☐ Can prospector ignore tests dir? document this in the gist if so