Skip to content

Commit

Permalink
Convert options to strings
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Nov 2, 2023
1 parent 08d5927 commit badc597
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/ert/config/queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ def generate_dict(option_list: List[Tuple[str, str]]) -> Dict[str, List[str]]:


def _validate_queue_driver_settings(
queue_system_options: List[Tuple[ContextString, ContextString]], queue_type: str
queue_system_options: List[Tuple[str, str]], queue_type: str
) -> None:
for option_strings in queue_system_options:
option_name = option_strings[0]
# this might come as a number already
option_value = str(option_strings[1])
option_value = option_strings[1]

if option_value == "": # This is equivalent to the option not being set
continue
if (
Expand Down
8 changes: 4 additions & 4 deletions tests/unit_tests/config/config_dict_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ def valid_queue_values(option_name, queue_system):
if option_name in queue_string_options[queue_system]:
return words
elif option_name in queue_positive_number_options[queue_system]:
return small_floats
return small_floats.map(str)
elif option_name in queue_positive_int_options[queue_system]:
return positives
return positives.map(str)
elif option_name in queue_bool_options[queue_system]:
return booleans
return booleans.map(str)
elif option_name in queue_memory_options[queue_system]:
return st.builds(str, memory_with_unit())
return memory_with_unit()
else:
raise ValueError(
"config_dict_generator does not know how to "
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 @@ -675,7 +675,7 @@ def test_queue_option_max_running_negative():
line=4,
column=32,
end_column=34,
match="is not a valid positive integer",
match="'-1' for MAX_RUNNING is not a valid positive integer.",
),
)

Expand Down

0 comments on commit badc597

Please sign in to comment.