From 13e79654cf09ad44c7f0eb6846cdf36b9d03a6fe Mon Sep 17 00:00:00 2001 From: Tuck Williamson Date: Tue, 11 Nov 2025 16:02:51 -0500 Subject: [PATCH] Fixed #18. --- src/agh/pytest_plugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/agh/pytest_plugin.py b/src/agh/pytest_plugin.py index 15c3182..5e76eb5 100644 --- a/src/agh/pytest_plugin.py +++ b/src/agh/pytest_plugin.py @@ -202,6 +202,9 @@ def run_executable( for core_file in agh_submission.evaluation_directory.glob(f"{CORE_DUMP_FILE_NAME}.*"): core_file.unlink() + if "stdin" in kwargs.keys() and kwargs["stdin"] is not None and isinstance(kwargs["stdin"], str): + shell_cmd_line = f"bash -c 'echo -e \"{kwargs['stdin']}\" | {shell_cmd_line}'" + result = shell.run(shell_cmd_line, shell=True, cwd=agh_submission.evaluation_directory, **kwargs) if parent_section is None: