              with self.assertRaises((GEOSException, ValueError)):
                  fromstr(err.wkt)
  
          # Bad WKB
          self.assertRaises(GEOSException, GEOSGeometry, six.memoryview(b'0'))
  
          class NotAGeometry(object):
              pass
  
          # Some other object
 
</s> remove         self.assertRaises(TypeError, GEOSGeometry, NotAGeometry())
 </s> add         with self.assertRaises(TypeError):
            GEOSGeometry(NotAGeometry()) </s> remove         self.assertRaises(TypeError, GEOSGeometry, None)
 </s> add         with self.assertRaises(TypeError):
            GEOSGeometry(None) </s> remove         self.assertRaises(ImproperlyConfigured, get_user, request)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            get_user(request) </s> remove         self.assertRaises(InvalidCacheBackendError, self.backend)
 </s> add         with self.assertRaises(InvalidCacheBackendError):
            self.backend() </s> remove         self.assertRaises(FieldError, Choice.objects.filter, foo__exact=None)
 </s> add         with self.assertRaises(FieldError):
            Choice.objects.filter(foo__exact=None)
        with self.assertRaises(GEOSException):
            GEOSGeometry(six.memoryview(b'0'))
              with self.assertRaises((GEOSException, ValueError)):
                  fromstr(err.wkt)
  
          # Bad WKB
        with self.assertRaises(GEOSException):
            GEOSGeometry(six.memoryview(b'0'))
  
          class NotAGeometry(object):
              pass
  
          # Some other object
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