message: Add unit test that includes multiple return statements mixed with except blocks.
diff: @@ -49,7 +49,7 @@ class SingleReturnTest(converter_testing.TestCase):
  self.assertTransformedEquivalent(test_fn, 2)
  self.assertTransformedEquivalent(test_fn, -2)
  - def test_missing_else(self):
  + def test_contitional_missing_else(self):
  def test_fn(x):
  if x > 0:
  @@ -58,7 +58,7 @@ class SingleReturnTest(converter_testing.TestCase):
  self.assertTransformedEquivalent(test_fn, 2)
  self.assertTransformedEquivalent(test_fn, -2)
  - def test_missing_else_then_default(self):
  + def test_conditional_missing_else_then_default(self):
  def test_fn(x):
  if x > 0:
  @@ -68,7 +68,7 @@ class SingleReturnTest(converter_testing.TestCase):
  self.assertTransformedEquivalent(test_fn, 2)
  self.assertTransformedEquivalent(test_fn, -2)
  - def test_else_only_then_default(self):
  + def test_conditional_else_only_then_default(self):
  def test_fn(x):
  if x < 0:
  @@ -216,6 +216,25 @@ class SingleReturnTest(converter_testing.TestCase):
  self.assertTransformedEquivalent(test_fn, 3)
  self.assertTransformedEquivalent(test_fn, 4)
  + def test_multiple_returns_in_nested_scope(self):
  +
  + def test_fn(a):
  + v = []
  + for x in a:
  + x -= 1
  + if x > 100:
  + return v
  + try:
  + raise ValueError('intentional')
  + except ValueError: # pylint:disable=bare-except
  + return v
  + v.append(x)
  + return v
  +
  + self.assertTransformedEquivalent(test_fn, [])
  + self.assertTransformedEquivalent(test_fn, [1])
  + self.assertTransformedEquivalent(test_fn, [2])
  + self.assertTransformedEquivalent(test_fn, [1, 2, 3])
  if __name__ == '__main__':
  test.main()
  