Command-Line Reference#
ModuleTester provides two entry points: the GUI launcher and the CLI utility.
GUI launcher: moduletester#
Launch the graphical interface.
$ moduletester [OPTIONS]
Options
Flag |
Type |
Description |
|---|---|---|
|
str |
Python package to load on startup. The package must be importable. |
|
str |
Path to a |
Examples
# Launch with no project (empty window)
$ moduletester
# Open directly on a package
$ moduletester -p guidata
# Open a saved project file
$ moduletester -f /path/to/project.moduletester
Note
--package and --file are mutually exclusive. If both are provided,
only one will be used.
CLI utility: moduletester-cli#
Run tests and export reports without the GUI.
$ moduletester-cli <command> [OPTIONS]
Commands
Command |
Description |
|---|---|
|
Run all tests of the given Python package headlessly. |
|
Export test results to a document. |
Export options
Flag |
Type |
Description |
|---|---|---|
|
str |
Output file path. The format is inferred from the file extension
( |
Examples
# Run all tests of a package
$ moduletester-cli run mypackage
# Export results to HTML
$ moduletester-cli export mypackage --output report.html
Python API#
You can also launch ModuleTester programmatically:
from moduletester.gui.main import run_gui
# Launches the GUI (blocking call)
run_gui()
Or use the run() function for more control:
from guidata.qthelpers import qt_app_context
from moduletester.gui.main import run
with qt_app_context(True):
main = run(package="mypackage")
main.window.show()