Skip to content

Add context manager to temporarily override configuration options #622

@adamchainz

Description

@adamchainz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions