Skip to content

Commit 9ef08d6

Browse files
authored
Merge pull request #937 from greyltc/python3point10-test-fix
let test_that_invalid_syntax_in_script_fails_immediately work in py3.10
2 parents 4a15629 + d588093 commit 9ef08d6

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+
exception = None
117+
try:
118+
cqgi.CQModel(badscript)
119+
except Exception as e:
120+
exception = e
118121

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

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

0 commit comments

Comments
 (0)