          self.assertRaises(GeoIPException, cntry_g.city, 'google.com')
          self.assertRaises(GeoIPException, cntry_g.coords, 'yahoo.com')
  
          # Non-string query should raise TypeError
          self.assertRaises(TypeError, cntry_g.country_code, 17)
          self.assertRaises(TypeError, cntry_g.country_name, GeoIP)
  
      def test03_country(self):
          "Testing GeoIP country querying methods."
          g = GeoIP(city='<foo>')
  
 
</s> remove         self.assertRaises(GeoIPException, cntry_g.city, 'google.com')
        self.assertRaises(GeoIPException, cntry_g.coords, 'yahoo.com')
 </s> add         with self.assertRaises(GeoIPException):
            cntry_g.city('google.com')
        with self.assertRaises(GeoIPException):
            cntry_g.coords('yahoo.com') </s> remove         self.assertRaises(TypeError, cntry_g.country_code, 17)
        self.assertRaises(TypeError, cntry_g.country_name, GeoIP2)
 </s> add         with self.assertRaises(TypeError):
            cntry_g.country_code(17)
        with self.assertRaises(TypeError):
            cntry_g.country_name(GeoIP2) </s> remove         self.assertRaises(GeoIP2Exception, cntry_g.city, 'tmc.edu')
        self.assertRaises(GeoIP2Exception, cntry_g.coords, 'tmc.edu')
 </s> add         with self.assertRaises(GeoIP2Exception):
            cntry_g.city('tmc.edu')
        with self.assertRaises(GeoIP2Exception):
            cntry_g.coords('tmc.edu') </s> remove             self.assertRaises(e, GeoIP, bad, 0)
 </s> add             with self.assertRaises(e):
                GeoIP(bad, 0) </s> remove         self.assertRaises(TypeError, GEOSGeometry, None)
 </s> add         with self.assertRaises(TypeError):
            GEOSGeometry(None)
        with self.assertRaises(TypeError):
            cntry_g.country_code(17)
        with self.assertRaises(TypeError):
            cntry_g.country_name(GeoIP)
          self.assertRaises(GeoIPException, cntry_g.city, 'google.com')
          self.assertRaises(GeoIPException, cntry_g.coords, 'yahoo.com')
  
          # Non-string query should raise TypeError
        with self.assertRaises(TypeError):
            cntry_g.country_code(17)
        with self.assertRaises(TypeError):
            cntry_g.country_name(GeoIP)
        with self.assertRaises(TypeError):
            cntry_g.country_code(17)
        with self.assertRaises(TypeError):
            cntry_g.country_name(GeoIP)
  
      def test03_country(self):
          "Testing GeoIP country querying methods."
          g = GeoIP(city='<foo>')
  
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/test_geoip.py