diff --git a/tested/languages/python/generators.py b/tested/languages/python/generators.py index 82965aaa..450c7e45 100644 --- a/tested/languages/python/generators.py +++ b/tested/languages/python/generators.py @@ -141,6 +141,7 @@ def convert_execution_unit(pu: PreparedExecutionUnit) -> str: import sys import importlib from decimal import Decimal +import builtins """ # Import the language specific functions we will need. @@ -152,6 +153,14 @@ def convert_execution_unit(pu: PreparedExecutionUnit) -> str: value_file = open("{pu.value_file}", "w") exception_file = open("{pu.exception_file}", "w") + +# Overwrite the input function +__old_input = builtins.input +def _our_input(_prompt=None): + return __old_input() +builtins.input = _our_input + + def write_separator(): value_file.write("--{pu.testcase_separator_secret}-- SEP") exception_file.write("--{pu.testcase_separator_secret}-- SEP")