Add context manager to temporarily override configuration options
adamchainz opened this issue · 0 comments
adamchainz commented
Tests currently use a lot of try/finally
clauses to undo the changes they make to configuration:
try:
...
finally:
Config.reset_all()
It would be nice to replace this with a context manager that allows temporary configuration overrides, to make tests a bit more ergonomic.