  
          # Ensuring bad output dimensions are not accepted
          for bad_outdim in (-1, 0, 1, 4, 423, 'foo', None):
              # Equivalent of `wkb_w.outdim = bad_outdim`
              self.assertRaises(ValueError, wkb_w._set_outdim, bad_outdim)
  
          # Now setting the output dimensions to be 3
          wkb_w.outdim = 3
  
          self.assertEqual(hex3d, wkb_w.write_hex(g))
 
</s> remove             self.assertRaises(ValueError, wkb_w._set_byteorder, bad_byteorder)
 </s> add             with self.assertRaises(ValueError):
                wkb_w._set_byteorder(bad_byteorder) </s> remove         self.assertRaises(TypeError, qs.kml, 'name')
 </s> add         with self.assertRaises(TypeError):
            qs.kml('name') </s> remove         self.assertRaises(LayerMapError, lm.save, fid_range=fr, step=10)
 </s> add         with self.assertRaises(LayerMapError):
            lm.save(fid_range=fr, step=10) </s> remove             self.assertRaises(TypeError, fg1._set_ptr, bad_ptr)
            self.assertRaises(TypeError, fg2._set_ptr, bad_ptr)
 </s> add             with self.assertRaises(TypeError):
                fg1._set_ptr(bad_ptr)
            with self.assertRaises(TypeError):
                fg2._set_ptr(bad_ptr) </s> remove         self.assertRaises(TypeError, City.objects.svg, precision='foo')
 </s> add         with self.assertRaises(TypeError):
            City.objects.svg(precision='foo')
            with self.assertRaises(ValueError):
                wkb_w._set_outdim(bad_outdim)
  
          # Ensuring bad output dimensions are not accepted
          for bad_outdim in (-1, 0, 1, 4, 423, 'foo', None):
              # Equivalent of `wkb_w.outdim = bad_outdim`
            with self.assertRaises(ValueError):
                wkb_w._set_outdim(bad_outdim)
  
          # Now setting the output dimensions to be 3
          wkb_w.outdim = 3
  
          self.assertEqual(hex3d, wkb_w.write_hex(g))
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