Skip to content

Commit c19e535

Browse files
authored
let test_that_invalid_syntax_in_script_fails_immediately work in python 3.10
fixes #933
1 parent 9ceea9c commit c19e535

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_cqgi.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,13 @@ def test_that_invalid_syntax_in_script_fails_immediately(self):
113113
"""
114114
)
115115

116-
with self.assertRaises(Exception) as context:
117-
model = cqgi.CQModel(badscript)
116+
xcptn = None
117+
try:
118+
cqgi.CQModel(badscript)
119+
except Exception as e:
120+
xcptn = e
118121

119-
self.assertTrue("invalid syntax" in context.exception.args)
122+
self.assertIsInstance(xcptn, SyntaxError)
120123

121124
def test_that_two_results_are_returned(self):
122125
script = textwrap.dedent(

0 commit comments

Comments
 (0)