  
          def setfcn(x, i):
              x[:i] = []
          for i in range(len(ul) - ul._minlength + 1, len(ul)):
              self.assertRaises(ValueError, delfcn, ul, i)
              self.assertRaises(ValueError, setfcn, ul, i)
          del ul[:len(ul) - ul._minlength]
  
          ul._maxlength = 4
          for i in range(0, ul._maxlength - len(ul)):
              ul.append(i)
 
</s> remove         self.assertRaises(ValueError, ul.append, 10)
 </s> add         with self.assertRaises(ValueError):
            ul.append(10) </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) </s> remove             self.assertRaises(IndexError, ul._checkindex, i)
 </s> add             with self.assertRaises(IndexError):
                ul._checkindex(i) </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(ValueError, setfcn, ul, i, j, k, sliceLen + 1)
 </s> add                         with self.assertRaises(ValueError):
                            setfcn(ul, i, j, k, sliceLen + 1)
            with self.assertRaises(ValueError):
                delfcn(ul, i)
            with self.assertRaises(ValueError):
                setfcn(ul, i)
  
          def setfcn(x, i):
              x[:i] = []
          for i in range(len(ul) - ul._minlength + 1, len(ul)):
            with self.assertRaises(ValueError):
                delfcn(ul, i)
            with self.assertRaises(ValueError):
                setfcn(ul, i)
            with self.assertRaises(ValueError):
                delfcn(ul, i)
            with self.assertRaises(ValueError):
                setfcn(ul, i)
          del ul[:len(ul) - ul._minlength]
  
          ul._maxlength = 4
          for i in range(0, ul._maxlength - len(ul)):
              ul.append(i)
keep keep keep keep replace 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