                  self.assertEqual(r.geom_type, 'LinearRing')
                  self.assertEqual(r.geom_typeid, 2)
  
              # Testing polygon construction.
              self.assertRaises(TypeError, Polygon, 0, [1, 2, 3])
              self.assertRaises(TypeError, Polygon, 'foo')
  
              # Polygon(shell, (hole1, ... holeN))
              rings = tuple(r for r in poly)
              self.assertEqual(poly, Polygon(rings[0], rings[1:]))
  
 
</s> remove             self.assertRaises(IndexError, poly.__getitem__, len(poly))
            self.assertRaises(IndexError, poly.__setitem__, len(poly), False)
            self.assertRaises(IndexError, poly.__getitem__, -1 * len(poly) - 1)
 </s> add             with self.assertRaises(IndexError):
                poly.__getitem__(len(poly))
            with self.assertRaises(IndexError):
                poly.__setitem__(len(poly), False)
            with self.assertRaises(IndexError):
                poly.__getitem__(-1 * len(poly) - 1) </s> remove         self.assertRaises(TypeError, ls.__setitem__, 0, (1., 2.))
 </s> add         with self.assertRaises(TypeError):
            ls.__setitem__(0, (1., 2.)) </s> remove             self.assertRaises(ValueError, http.base36_to_int, n)
 </s> add             with self.assertRaises(ValueError):
                http.base36_to_int(n) </s> remove         self.assertRaises(TypeError, GEOSGeometry, None)
 </s> add         with self.assertRaises(TypeError):
            GEOSGeometry(None) </s> remove             self.assertRaises(TypeError, poly.__setitem__, 0, LineString((1, 1), (2, 2)))
 </s> add             with self.assertRaises(TypeError):
                poly.__setitem__(0, LineString((1, 1), (2, 2)))
            with self.assertRaises(TypeError):
                Polygon(0, [1, 2, 3])
            with self.assertRaises(TypeError):
                Polygon('foo')
                  self.assertEqual(r.geom_type, 'LinearRing')
                  self.assertEqual(r.geom_typeid, 2)
  
              # Testing polygon construction.
            with self.assertRaises(TypeError):
                Polygon(0, [1, 2, 3])
            with self.assertRaises(TypeError):
                Polygon('foo')
            with self.assertRaises(TypeError):
                Polygon(0, [1, 2, 3])
            with self.assertRaises(TypeError):
                Polygon('foo')
  
              # Polygon(shell, (hole1, ... holeN))
              rings = tuple(r for r in poly)
              self.assertEqual(poly, Polygon(rings[0], rings[1:]))
  
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/geos_tests/test_geos.py