          for p in self.geometries.polygons:
              poly = fromstr(p.wkt)
  
              # Should only be able to use __setitem__ with LinearRing geometries.
              self.assertRaises(TypeError, poly.__setitem__, 0, LineString((1, 1), (2, 2)))
  
              # Constructing the new shell by adding 500 to every point in the old shell.
              shell_tup = poly.shell.tuple
              new_coords = []
              for point in shell_tup:
 
</s> remove         self.assertRaises(TypeError, City.objects.svg, precision='foo')
 </s> add         with self.assertRaises(TypeError):
            City.objects.svg(precision='foo') </s> remove         self.assertRaises(
            DatabaseError,
            self.column_classes, LocalBookWithM2M._meta.get_field("tags").remote_field.through
        )
 </s> add         with self.assertRaises(DatabaseError):
            self.column_classes(LocalBookWithM2M._meta.get_field("tags").remote_field.through) </s> remove             self.assertRaises(TypeError, fg1._set_ptr, bad_ptr)
            self.assertRaises(TypeError, fg2._set_ptr, bad_ptr)
 </s> add             with self.assertRaises(TypeError):
                fg1._set_ptr(bad_ptr)
            with self.assertRaises(TypeError):
                fg2._set_ptr(bad_ptr) </s> remove         self.assertRaises(TypeError, qs.kml, 'name')
 </s> add         with self.assertRaises(TypeError):
            qs.kml('name') </s> remove             self.assertRaises(ValueError, wkb_w._set_outdim, bad_outdim)
 </s> add             with self.assertRaises(ValueError):
                wkb_w._set_outdim(bad_outdim)
            with self.assertRaises(TypeError):
                poly.__setitem__(0, LineString((1, 1), (2, 2)))
          for p in self.geometries.polygons:
              poly = fromstr(p.wkt)
  
              # Should only be able to use __setitem__ with LinearRing geometries.
            with self.assertRaises(TypeError):
                poly.__setitem__(0, LineString((1, 1), (2, 2)))
  
              # Constructing the new shell by adding 500 to every point in the old shell.
              shell_tup = poly.shell.tuple
              new_coords = []
              for point in shell_tup:
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