Add context manager to temporarily override configuration options

Open
#622 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
testing

Research direction

Search the test suite for try/finally blocks that call Config.reset_all(), then inspect the configuration implementation and its reset behavior. Add a context manager for temporary configuration overrides and verify that configuration is restored after the context exits, including when the body raises an exception.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
77
Forks
19
Avg merge
1d 9h
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from scoutapp/scout_apm_python

All issues in scoutapp/scout_apm_python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.