pytest-dev / pytest-dev/pytest
Allow interpolating values into getini help
Open
Nobody has claimed this yet.
topic: config
type: enhancement
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
What's the problem this feature will solve?
The help parameter to parser.addoption() allows interpolating other parameters in the help string, e.g.
parser.addoption("--foo", help="Foo, defaults to %(default)s", default="asdf")
It would be great if parser.addini() supported the same, e.g.
parser.addini("foo", help="Foo, defaults to %(default)s", default="asdf")
Alternative Solutions
One can manually interpolate, or just duplicate it
default = "asdf"
parser.addini("foo", help=f"Foo, defaults to {default}", default=default)
parser.addini("foo", help="Foo, defaults to asdf", default="asdf")
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating parser.addini and the existing parser.addoption help interpolation behavior, then find the related parser tests. Confirm that a %(default)s placeholder in an addini help string uses the supplied default value, while preserving the documented addoption behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100