def test_unbalanced_exception():
 try:
  tokenize('(bar))')
  assert (True is False)
 except LexException:
  pass
 try:
  tokenize('(baz [quux]])')
  assert (True is False)
 except LexException:
  pass

def test_unbalanced_exception ( ) : try : tokenize ( '(bar))' ) assert ( True is False ) except LexException : pass try : tokenize ( '(baz [quux]])' ) assert ( True is False ) except LexException : pass
ensure the tokenization fails on unbalanced expressions .