Add additional flag CLI flag to the Ini Options: --config-file
#11031
Labels
topic: config
related to config handling, argument parsing and config file
type: enhancement
new feature or API change, should be merged into features branch
Add additional flag CLI flag to the Ini Options:
--config-file
What's the current situation?
The PyTest config currently has one config flag that can be used for loading config from a file:
-c
. As outlined here and here.This means that if I wanted to run my
pytest
script from apyproject.toml
file, I'd need to run it like this:With the
pyproject.toml
file containing the following config:What's the problem this feature will solve?
The current solution works. However, for someone new to the team, who see this flag
-c
, they'd need to go digging through the documentation to try and find out what it means. Which may take some time.Describe the solution you'd like
To streamline this process, I'd like to add an additional flag to the existing
-c
flag. This new flag should be a double-hyphen flag, and be either--config
or--config-file
.That way, it is clear and unmistakable what this flag would be doing.
Therefore, in addition to running the command like this:
This command should also work just the same if the command looked like this:
Additional context
By way of context, other Python packages that also supply config in the
pyproject.toml
file also have the longer version of the flag in their CLI config.For example:
--config-file CONFIG_FILE
. See here.--config FILE
. See here.It would be beneficial if PyTest could also implement a flag similar to Packages like this.
The text was updated successfully, but these errors were encountered: