Skip to content

Convert singletons to use a single datastore that gets reset between Python kernels/tests

finesse importer requested to merge datastore into master

Fixes #260 (closed). Also see #257 (closed).

Instead of the full dependency injection approach outlined in #260 (closed), I instead made a single "datastore" object in a new module finesse.datastore that single-instance objects share. This gets nuked by a new "autouse" fixture in pytest that runs before and after every test, forcing the single instances to be reset. This ensures global state is the same default for every test, so allows the CLI tests disabled in 58e437dc to be re-enabled. I also added a new test to check the traceback suppression behaviour with show_tracebacks set on and off.

Still to do is to test traceback suppression in various environments, since it should be enabled for interactive terminals but disabled for everything else. That's a checklist item in #257 (closed).

Merge request reports