  
      def test_relate_pattern(self):
          "Testing relate() and relate_pattern()."
          g = fromstr('POINT (0 0)')
          self.assertRaises(GEOSException, g.relate_pattern, 0, 'invalid pattern, yo')
          for rg in self.geometries.relate_geoms:
              a = fromstr(rg.wkt_a)
              b = fromstr(rg.wkt_b)
              self.assertEqual(rg.result, a.relate_pattern(b, rg.pattern))
              self.assertEqual(rg.pattern, a.relate(b))
 
</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, 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)
 </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(GEOSException):
            g.relate_pattern(0, 'invalid pattern, yo')
  
      def test_relate_pattern(self):
          "Testing relate() and relate_pattern()."
          g = fromstr('POINT (0 0)')
        with self.assertRaises(GEOSException):
            g.relate_pattern(0, 'invalid pattern, yo')
          for rg in self.geometries.relate_geoms:
              a = fromstr(rg.wkt_a)
              b = fromstr(rg.wkt_b)
              self.assertEqual(rg.result, a.relate_pattern(b, rg.pattern))
              self.assertEqual(rg.pattern, a.relate(b))
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