          # (in `bad_ptrs`) will not be allowed.
          bad_ptrs = (5, ctypes.c_char_p(b'foobar'))
          for bad_ptr in bad_ptrs:
              # Equivalent to `fg.ptr = bad_ptr`
              self.assertRaises(TypeError, fg1._set_ptr, bad_ptr)
              self.assertRaises(TypeError, fg2._set_ptr, bad_ptr)
  
      def test_wkt(self):
          "Testing WKT output."
          for g in self.geometries.wkt_out:
              geom = fromstr(g.wkt)
 
</s> remove         self.assertRaises(TypeError, GEOSGeometry, None)
 </s> add         with self.assertRaises(TypeError):
            GEOSGeometry(None) </s> remove             self.assertRaises(GEOSException, fg._get_ptr)
 </s> add             with self.assertRaises(GEOSException):
                fg._get_ptr() </s> remove         self.assertRaises(TypeError, wkt_r.read, 1)
        self.assertRaises(TypeError, wkt_r.read, memoryview(b'foo'))
 </s> add         with self.assertRaises(TypeError):
            wkt_r.read(1)
        with self.assertRaises(TypeError):
            wkt_r.read(memoryview(b'foo')) </s> remove             self.assertRaises(ValueError, wkb_w._set_outdim, bad_outdim)
 </s> add             with self.assertRaises(ValueError):
                wkb_w._set_outdim(bad_outdim) </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):
                fg1._set_ptr(bad_ptr)
            with self.assertRaises(TypeError):
                fg2._set_ptr(bad_ptr)
          # (in `bad_ptrs`) will not be allowed.
          bad_ptrs = (5, ctypes.c_char_p(b'foobar'))
          for bad_ptr in bad_ptrs:
              # Equivalent to `fg.ptr = bad_ptr`
            with self.assertRaises(TypeError):
                fg1._set_ptr(bad_ptr)
            with self.assertRaises(TypeError):
                fg2._set_ptr(bad_ptr)
            with self.assertRaises(TypeError):
                fg1._set_ptr(bad_ptr)
            with self.assertRaises(TypeError):
                fg2._set_ptr(bad_ptr)
  
      def test_wkt(self):
          "Testing WKT output."
          for g in self.geometries.wkt_out:
              geom = fromstr(g.wkt)
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