nuketesting.runner.cli ====================== .. py:module:: nuketesting.runner.cli .. autoapi-nested-parse:: Script to parse CLI args and invoke the test runner. Attributes ---------- .. autoapisummary:: nuketesting.runner.cli.NO_CONFIG_FOUND_ERROR nuketesting.runner.cli.RUNNER_AND_EXE_PROVIDED_ERROR nuketesting.runner.cli.RUNNER_OR_EXE_MISSING_ERROR Exceptions ---------- .. autoapisummary:: nuketesting.runner.cli.CLICommandError Classes ------- .. autoapisummary:: nuketesting.runner.cli.CLIRunArguments Functions --------- .. autoapisummary:: nuketesting.runner.cli.main Module Contents --------------- .. py:exception:: CLICommandError Bases: :py:obj:`Exception` Exception to raise when provided commands are invalid. .. py:class:: CLIRunArguments Object to store all passed arguments into a single dataclass and run. .. py:method:: __post_init__() -> None Post initialize checks for the arguments. .. py:attribute:: config :type: pathlib.Path | None :value: None Config JSON to override everything and have a predefined test run. .. py:attribute:: nuke_executable :type: pathlib.Path | None :value: None Path to Nuke executable. .. py:attribute:: pytest_args :type: tuple[str] :value: () Additional arguments to forward to pytest. .. py:attribute:: run_in_terminal_mode :type: bool :value: True Run tests in Nuke using the native terminal mode or using the current Python interpreter. .. py:attribute:: runner_name :type: str | None :value: None Optional name of a runner to run. This will only run the runner with the name. .. py:attribute:: test_directory :type: pathlib.Path Directory specified by user to test. Defaults to current directory. .. py:data:: NO_CONFIG_FOUND_ERROR .. py:data:: RUNNER_AND_EXE_PROVIDED_ERROR .. py:data:: RUNNER_OR_EXE_MISSING_ERROR .. py:function:: main(nuke_executable: click.Path, test_path: click.Path, config: click.Path, terminal: bool, pytest_arg: list, runner_name: str) -> NoReturn 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