  
      def test02_wktwriter(self):
          # Creating a WKTWriter instance, testing its ptr property.
          wkt_w = WKTWriter()
          self.assertRaises(TypeError, wkt_w._set_ptr, WKTReader.ptr_type())
  
          ref = GEOSGeometry('POINT (5 23)')
          ref_wkt = 'POINT (5.0000000000000000 23.0000000000000000)'
          self.assertEqual(ref_wkt, wkt_w.write(ref).decode())
  
 
</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(TypeError, wkb_r.read, bad_wkb)
 </s> add             with self.assertRaises(TypeError):
                wkb_r.read(bad_wkb) </s> remove         self.assertRaises(GEOSException, g.transform, 2774, clone=True)
 </s> add         with self.assertRaises(GEOSException):
            g.transform(2774, clone=True) </s> remove         self.assertRaises(GEOSException, g.transform, 2774)
 </s> add         with self.assertRaises(GEOSException):
            g.transform(2774) </s> remove         self.assertRaises(GEOSException, g.transform, 2774, clone=True)
 </s> add         with self.assertRaises(GEOSException):
            g.transform(2774, clone=True)
        with self.assertRaises(TypeError):
            wkt_w._set_ptr(WKTReader.ptr_type())
  
      def test02_wktwriter(self):
          # Creating a WKTWriter instance, testing its ptr property.
          wkt_w = WKTWriter()
        with self.assertRaises(TypeError):
            wkt_w._set_ptr(WKTReader.ptr_type())
  
          ref = GEOSGeometry('POINT (5 23)')
          ref_wkt = 'POINT (5.0000000000000000 23.0000000000000000)'
          self.assertEqual(ref_wkt, wkt_w.write(ref).decode())
  
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_io.py