Description
Add a moduletester init CLI command that interactively generates the moduletester.ini configuration file, creates the recommended test directory structure, and optionally adds # guitest: markers to existing test files. This reduces onboarding time to under a minute for new projects.
Current behavior
- Users must manually create
moduletester.ini from scratch or copy from another project.
- No guidance on recommended directory structure or marker usage.
- Easy to miss required configuration options.
Expected behavior
- Running
moduletester init in a project root starts an interactive wizard:
$ moduletester init
Project name [my_project]: mypackage
Test package [mypackage.tests]: mypackage.tests
Test directory [tests/]: tests/
Add guitest markers to existing test files? [y/N]: y
Export format [html/docx/both]: html
Created moduletester.ini
Scanned 12 test files, added markers to 8 files.
Ready! Run: moduletester -p mypackage.tests
- Generates a well-commented
moduletester.ini with sensible defaults.
- Optionally scans existing test files and adds
# guitest: show markers.
- Creates missing directories if needed.
Implementation ideas
- Add
init subcommand to the existing CLI entry point.
- Use
input() prompts or questionary library for interactive mode.
- Support
--non-interactive flag with CLI arguments for CI usage.
- Template
moduletester.ini with comments explaining each option.
- File scanner that detects
def test_ or class Test patterns and adds markers.
Acceptance criteria
Description
Add a
moduletester initCLI command that interactively generates themoduletester.iniconfiguration file, creates the recommended test directory structure, and optionally adds# guitest:markers to existing test files. This reduces onboarding time to under a minute for new projects.Current behavior
moduletester.inifrom scratch or copy from another project.Expected behavior
moduletester initin a project root starts an interactive wizard:moduletester.iniwith sensible defaults.# guitest: showmarkers.Implementation ideas
initsubcommand to the existing CLI entry point.input()prompts orquestionarylibrary for interactive mode.--non-interactiveflag with CLI arguments for CI usage.moduletester.iniwith comments explaining each option.def test_orclass Testpatterns and adds markers.Acceptance criteria
moduletester initgenerates a validmoduletester.inimoduletester.iniwithout confirmation