From ee25dc729c5697737dc2ed1e6c9364a95b6c3c05 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Tue, 29 Jun 2021 19:11:01 -0700 Subject: [PATCH] Fix command compiler test (#1675) --- src/tests/test_console.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tests/test_console.py b/src/tests/test_console.py index ff0796124..6f280714a 100644 --- a/src/tests/test_console.py +++ b/src/tests/test_console.py @@ -14,24 +14,24 @@ from pyodide import CodeRunner def test_command_compiler(): c = _CodeRunnerCompile() with pytest.raises(SyntaxError, match="unexpected EOF while parsing"): - c("def test():\n 1", "", "exec") - assert isinstance(c("def test():\n 1\n", "", "exec"), CodeRunner) + c("def test():\n 1", "", "single") + assert isinstance(c("def test():\n 1\n", "", "single"), CodeRunner) with pytest.raises(SyntaxError, match="invalid syntax"): - c("1<>2", "", "exec") + c("1<>2", "", "single") assert isinstance( - c("from __future__ import barry_as_FLUFL", "", "exec"), CodeRunner + c("from __future__ import barry_as_FLUFL", "", "single"), CodeRunner ) - assert isinstance(c("1<>2", "", "exec"), CodeRunner) + assert isinstance(c("1<>2", "", "single"), CodeRunner) c = _CodeRunnerCommandCompiler() - assert c("def test():\n 1", "", "exec") is None - assert isinstance(c("def test():\n 1\n", "", "exec"), CodeRunner) + assert c("def test():\n 1", "", "single") is None + assert isinstance(c("def test():\n 1\n", "", "single"), CodeRunner) with pytest.raises(SyntaxError, match="invalid syntax"): - c("1<>2", "", "exec") + c("1<>2", "", "single") assert isinstance( - c("from __future__ import barry_as_FLUFL", "", "exec"), CodeRunner + c("from __future__ import barry_as_FLUFL", "", "single"), CodeRunner ) - assert isinstance(c("1<>2", "", "exec"), CodeRunner) + assert isinstance(c("1<>2", "", "single"), CodeRunner) def test_stream_redirection():