test: Restructure test files
Some checks are pending
website / deploy (push) Blocked by required conditions
website / build (push) Waiting to run

Extract the individual parsing tests (cli, env, rc) and add additional
configuration test file (TConf and config builder).

To extract the fixtures they have to go into an additional 'conftest.py'
file for pytest to recognize and automatically import them, see:
https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files

and:
https://docs.pytest.org/en/stable/how-to/fixtures.html#using-fixtures-from-other-projects
This commit is contained in:
Marty Oehme 2025-11-29 11:18:48 +01:00
parent ff0e6cccfb
commit 13c34b08e2
Signed by: Marty
GPG key ID: 4E535BC19C61886E
6 changed files with 224 additions and 114 deletions

View file

@ -132,7 +132,7 @@ class Opt:
metavar: str | None = None
cast: type | Callable = str
help_text: str = ""
flag: bool = False
is_flag: bool = False
def _real_path(p: Path | str) -> Path:
@ -224,7 +224,8 @@ OPTIONS: dict[str, Opt] = {
"notes.quiet",
default=False,
cast=_strtobool,
help_text="Silence any verbose displayed information",
help_text="Silence any verbosely displayed information",
is_flag=True,
),
}
@ -321,6 +322,15 @@ you view the task.
for key, opt in OPTIONS.items():
if opt.cli is None:
continue
if opt.is_flag:
parser.add_argument(
*opt.cli,
dest=key,
help=opt.help_text,
default=None,
action="store_true",
)
continue
parser.add_argument(
*opt.cli,
dest=key,