Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openmc/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _process_CLI_arguments(volume=False, geometry_debug=False, particles=None,
args = mpi_args + args

if path_input is not None:
args += [path_input]
args += [str(path_input)]

return args

Expand Down
17 changes: 17 additions & 0 deletions tests/unit_tests/test_executor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pathlib import Path

from openmc.executor import _process_CLI_arguments


def test_process_cli_arguments_path_input_str(tmp_path):
# _process_CLI_arguments must return a list of str: openmc.lib.init
# calls .encode() on each argument (#4185)
args = list(_process_CLI_arguments(path_input=str(tmp_path)))
assert args[-1] == str(tmp_path)
assert all(isinstance(arg, str) for arg in args)


def test_process_cli_arguments_path_input_pathlike(tmp_path):
args = list(_process_CLI_arguments(path_input=Path(tmp_path)))
assert args[-1] == str(tmp_path)
assert all(isinstance(arg, str) for arg in args)
Loading