                          pl[i:j:k] = ssl
                          self.assertEqual(pl, ul[:], 'set slice [%d:%d:%d]' % (i, j, k))
  
                          sliceLen = len(ul[i:j:k])
                          self.assertRaises(ValueError, setfcn, ul, i, j, k, sliceLen + 1)
                          if sliceLen > 2:
                              self.assertRaises(ValueError, setfcn, ul, i, j, k, sliceLen - 1)
  
                  for k in self.step_range():
                      ssl = nextRange(len(ul[i::k]))
 
</s> remove                             self.assertRaises(ValueError, setfcn, ul, i, j, k, sliceLen - 1)
 </s> add                             with self.assertRaises(ValueError):
                                setfcn(ul, i, j, k, sliceLen - 1) </s> remove         self.assertRaises(TypeError, setfcn, ul, slice(0, 3, 2), 2)
 </s> add         with self.assertRaises(TypeError):
            setfcn(ul, slice(0, 3, 2), 2) </s> remove             self.assertRaises(ValueError, delfcn, ul, i)
            self.assertRaises(ValueError, setfcn, ul, i)
 </s> add             with self.assertRaises(ValueError):
                delfcn(ul, i)
            with self.assertRaises(ValueError):
                setfcn(ul, i) </s> remove         self.assertRaises(TypeError, setfcn, ul, 2, 'hello')
        self.assertRaises(TypeError, setfcn, ul, slice(0, 3, 2), ('hello', 'goodbye'))
 </s> add         with self.assertRaises(TypeError):
            setfcn(ul, 2, 'hello')
        with self.assertRaises(TypeError):
            setfcn(ul, slice(0, 3, 2), ('hello', 'goodbye')) </s> remove             self.assertRaises(IndexError, setfcn, ul, i)  # 'set index %d' % i)
            self.assertRaises(IndexError, getfcn, ul, i)  # 'get index %d' % i)
            self.assertRaises(IndexError, delfcn, ul, i)  # 'del index %d' % i)
 </s> add             with self.assertRaises(IndexError):  # 'set index %d' % i)
                setfcn(ul, i)
            with self.assertRaises(IndexError):  # 'get index %d' % i)
                getfcn(ul, i)
            with self.assertRaises(IndexError):  # 'del index %d' % i)
                delfcn(ul, i)
                        with self.assertRaises(ValueError):
                            setfcn(ul, i, j, k, sliceLen + 1)
                          pl[i:j:k] = ssl
                          self.assertEqual(pl, ul[:], 'set slice [%d:%d:%d]' % (i, j, k))
  
                          sliceLen = len(ul[i:j:k])
                        with self.assertRaises(ValueError):
                            setfcn(ul, i, j, k, sliceLen + 1)
                          if sliceLen > 2:
                              self.assertRaises(ValueError, setfcn, ul, i, j, k, sliceLen - 1)
  
                  for k in self.step_range():
                      ssl = nextRange(len(ul[i::k]))
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_mutable_list.py