Skip to content

Commit

Permalink
Let the contextstring be figured automaticxally
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Oct 31, 2023
1 parent 844a1cc commit 97a7662
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/ert/config/queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,31 +211,31 @@ def _validate_queue_driver_settings(
f"'{option_value}' for {option_name} is not a valid format "
f"for {queue_type} QUEUE. It must be of "
"the format '<integer>mb' or '<integer>gb'.",
option_value.token,
option_value,
)
if option_name in string_options[queue_type] and not isinstance(
option_value, str
):
raise ConfigValidationError.with_context(
f"'{option_value}' for {option_name} is not a valid string type "
f"for the {queue_type} QUEUE.",
option_value.token,
option_value,
)
if option_name in positive_number_options[queue_type] and (
re.match(r"^\d+(\.\d+)?$", option_value) is None
):
raise ConfigValidationError.with_context(
f"'{option_value}' for {option_name} is not a valid integer or float"
f" for the {queue_type} QUEUE.",
option_value.token,
option_value,
)
if option_name in positive_int_options[queue_type] and (
re.match(r"^\d+$", option_value) is None
):
raise ConfigValidationError.with_context(
f"'{option_value}' for {option_name} is not a valid positive integer"
f" for the {queue_type} QUEUE.",
option_value.token,
option_value,
)
if option_name in bool_options[queue_type] and not option_value in [
"TRUE",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/config/test_parser_error_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def test_queue_option_max_running_non_int():
expected_error=ExpectedErrorInfo(
line=4,
column=32,
end_column=35,
end_column=33,
match=r"'ert' for MAX_RUNNING is not a valid positive integer for the LOCAL QUEUE.",
),
)
Expand Down

0 comments on commit 97a7662

Please sign in to comment.