Skip to content

ENH: Add AssertError exception string to output tool validation #1862

@liukidar

Description

@liukidar

Problem
The tool validation mechanism is quite consistent in raising a clear self-explainatory message when a condition is not met, except for:

# Validate output type
assert getattr(self, "output_type", None) in AUTHORIZED_TYPES

For which a message is not provided.

Proposed solution
Add an error message to the assertion, such as

# Validate output type
output_type = getattr(self, "output_type", None)
assert output_type in AUTHORIZED_TYPES, f"Output type '{output_type}': type must be one of the following values: {AUTHORIZED_TYPES}."

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions