nuketesting.runner.cli¶
Script to parse CLI args and invoke the test runner.
Attributes¶
Exceptions¶
Exception to raise when provided commands are invalid. |
Classes¶
Object to store all passed arguments into a single dataclass and run. |
Functions¶
|
Nuke Test Runner CLI Interface. |
Module Contents¶
- class CLIRunArguments¶
Object to store all passed arguments into a single dataclass and run.
- config: pathlib.Path | None = None¶
Config JSON to override everything and have a predefined test run.
- nuke_executable: pathlib.Path | None = None¶
Path to Nuke executable.
- run_in_terminal_mode: bool = True¶
Run tests in Nuke using the native terminal mode or using the current Python interpreter.
- runner_name: str | None = None¶
Optional name of a runner to run. This will only run the runner with the name.
- test_directory: pathlib.Path¶
Directory specified by user to test. Defaults to current directory.
- NO_CONFIG_FOUND_ERROR¶
- RUNNER_AND_EXE_PROVIDED_ERROR¶
- RUNNER_OR_EXE_MISSING_ERROR¶
- main(
- nuke_executable: click.Path,
- test_path: click.Path,
- config: click.Path,
- terminal: bool,
- pytest_arg: list,
- runner_name: str,
Nuke Test Runner CLI Interface.
This bootstraps Nuke within the test runner to be able to run pytest like usual, with all Nuke dependencies.
The test-path is the folder or file of the tests you want to execute. Use the pytest folder/file.py::class::method notation to run single tests. For further options consult the pytest documentation.
If you don’t specify the test-path it will use the current directory like pytest does.
Use the nuke-executable argument to specify the location of your nuke executable.
If you like to store the nuke-executable and some additional configuration, you can create a runners.json file and reference created runners with the runner-name argument:
NukeTestrunner –config runners.json –runner-name nuke15 –test-path /tests
If a “runners.json” is saved within the folder tree of the test path, it will be automatically loaded. Then you can use a shorter command:
NukeTestrunner –runner-name nuke15 –test-path /tests