              quadsegs = bg.quadsegs
              width = bg.width
  
              # Can't use a floating-point for the number of quadsegs.
              self.assertRaises(ctypes.ArgumentError, g.buffer, width, float(quadsegs))
  
              # Constructing our buffer
              buf = g.buffer(width, quadsegs)
              self.assertEqual(exp_buf.num_coords, buf.num_coords)
              self.assertEqual(len(exp_buf), len(buf))
 
</s> remove         self.assertRaises(ValueError, Choice.objects.filter, id__gt=None)
 </s> add         with self.assertRaises(ValueError):
            Choice.objects.filter(id__gt=None) </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))) </s> remove         self.assertRaises(FieldError, Choice.objects.filter, foo__exact=None)
 </s> add         with self.assertRaises(FieldError):
            Choice.objects.filter(foo__exact=None) </s> remove             self.assertRaises(ValueError, getattr, field, 'width')
            self.assertRaises(ValueError, getattr, field, 'height')
 </s> add             with self.assertRaises(ValueError):
                getattr(field, 'width')
            with self.assertRaises(ValueError):
                getattr(field, 'height') </s> remove         self.assertRaises(FieldError, Restaurant.objects.filter, supplier__name="foo")
 </s> add         with self.assertRaises(FieldError):
            Restaurant.objects.filter(supplier__name="foo")
            with self.assertRaises(ctypes.ArgumentError):
                g.buffer(width, float(quadsegs))
              quadsegs = bg.quadsegs
              width = bg.width
  
              # Can't use a floating-point for the number of quadsegs.
            with self.assertRaises(ctypes.ArgumentError):
                g.buffer(width, float(quadsegs))
  
              # Constructing our buffer
              buf = g.buffer(width, quadsegs)
              self.assertEqual(exp_buf.num_coords, buf.num_coords)
              self.assertEqual(len(exp_buf), len(buf))
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