diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/problems/introduction/fahrenheit_to_celsius/common.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/python/problems/introduction/fahrenheit_to_celsius/common.py b/python/problems/introduction/fahrenheit_to_celsius/common.py index 53a17f8..1555cf7 100644 --- a/python/problems/introduction/fahrenheit_to_celsius/common.py +++ b/python/problems/introduction/fahrenheit_to_celsius/common.py @@ -11,10 +11,9 @@ f = float(input("Temperatura [F]: ")) print("Temperatura je", c, "C") ''' -from python.engine import run from python.util import has_token_sequence -def test(code): +def test(session, code): # List of inputs: (expression to eval, stdin). test_in = [ (None, '0\n'), @@ -26,7 +25,7 @@ def test(code): ] # List of outputs: (expression result, stdout, stderr, exception). - answers = run(code=code, inputs=test_in, timeout=1.0) + answers = session.get_python().run(code=code, inputs=test_in, timeout=1.0) outputs = [ans[1] for ans in answers] n_correct = 0 @@ -35,7 +34,7 @@ def test(code): n_correct += 1 return n_correct, len(test_in) -def hint(code): +def hint(session, code): if not code: return [{'id': 'plan'}] if not has_token_sequence(code, ['input']): |