pytest-dev / pytest-dev/pytest

Add ability to get parsed configs

Open
#3,369 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement type: proposal
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

Could devs please add a high-level interface to get parsed configuration values, the ones which will eventually be used? Currently I check in request.config.option.myconfig (which comes from command-line) and if that's None then I check in request.config.getini('myconfig') (which comes from config file). I'm not sure if there can be maybe environment variables inbetween cmdline and file conf too, because I don't generally use those. It would be nice to have one config map to encapsulate this layered lookup (may I suggest a collections ChainMap - cmdline, environment, file, defaults)

...or is it already there, and I'm missing something obvious?

Contributor guide

Open the contributing guide

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.

Research direction

No file or test is named in the issue. Start by tracing the existing request.config.option and request.config.getini('myconfig') entry points, then determine how command-line, environment, file, and default values should be layered. Done means a documented high-level interface returns the parsed effective configuration value.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.