Skip to content

Commit 0c773ff

Browse files
committed
add test for bpython#347 (safe eval syntax error)
1 parent cb74f11 commit 0c773ff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bpython/test/test_autocomplete.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ def test_cw(self):
3434
self.assertEqual(self.repl.cw(), 'datetime')
3535
"""
3636

37+
class TestSafeEval(unittest.TestCase):
38+
def test_catches_syntax_error(self):
39+
try:
40+
autocomplete.safe_eval('1re',{})
41+
except:
42+
self.fail('safe_eval raises an error')
3743

3844
# make some fake files? Dependency inject? mock?
3945
class TestFilenameCompletion(unittest.TestCase):

0 commit comments

Comments
 (0)