Skip to content

Commit

Permalink
Change syntax error message for py 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
berinhard committed Dec 26, 2022
1 parent b4c1b7a commit 832612a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyp5js/tests/test_http/test_web_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import os
import platform
import shutil
from pathlib import Path

Expand Down Expand Up @@ -267,7 268,10 @@ def test_check_python_syntax_before_updating(self):
response = self.client.post(url, data={'py_code': test_code})

self.assert_template_used('view_sketch.html')
self.assert_context('error', 'SyntaxError: invalid syntax (sketch_exists.py, line 6)')
err_msg = 'SyntaxError: invalid syntax (sketch_exists.py, line 6)'
if platform.python_version().startswith("3.10"):
err_msg = "SyntaxError: '(' was never closed (sketch_exists.py, line 4)"
self.assert_context('error', err_msg)
assert old_content == sketch.sketch_py.read_text()

def test_check_for_setup_function_before_updating(self):
Expand Down

0 comments on commit 832612a

Please sign in to comment.