                  self.assertEqual(0, len(lr))
                  self.assertEqual(True, lr.empty)
                  self.assertRaises(IndexError, lr.__getitem__, 0)
              else:
                  self.assertRaises(IndexError, g.__getitem__, 0)
  
      def test_collection_dims(self):
          gc = GeometryCollection([])
          self.assertEqual(gc.dims, -1)
  
 
</s> remove                 self.assertRaises(IndexError, lr.__getitem__, 0)
 </s> add                 with self.assertRaises(IndexError):
                    lr.__getitem__(0) </s> remove             self.assertRaises(e, GeoIP2, bad, 0)
 </s> add             with self.assertRaises(e):
                GeoIP2(bad, 0) </s> remove             self.assertRaises(e, GeoIP, bad, 0)
 </s> add             with self.assertRaises(e):
                GeoIP(bad, 0) </s> remove             self.assertRaises(IndexError, mpnt.__getitem__, len(mpnt))
 </s> add             with self.assertRaises(IndexError):
                mpnt.__getitem__(len(mpnt)) </s> remove             self.assertRaises(IndexError, ul._checkindex, i)
 </s> add             with self.assertRaises(IndexError):
                ul._checkindex(i)
                with self.assertRaises(IndexError):
                    g.__getitem__(0)
                  self.assertEqual(0, len(lr))
                  self.assertEqual(True, lr.empty)
                  self.assertRaises(IndexError, lr.__getitem__, 0)
              else:
                with self.assertRaises(IndexError):
                    g.__getitem__(0)
  
      def test_collection_dims(self):
          gc = GeometryCollection([])
          self.assertEqual(gc.dims, -1)
  
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/geos_tests/test_geos.py