          def delfcn(x, i):
              del x[i]
          pl, ul = self.lists_of_len()
          for i in (-1 - self.limit, self.limit):
              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)
  
      def test06_list_methods(self):
          'List methods'
          pl, ul = self.lists_of_len()
          pl.append(40)
 
</s> remove         self.assertRaises(IndexError, popfcn, ul, self.limit)
        self.assertRaises(IndexError, popfcn, ul, -1 - self.limit)
 </s> add         with self.assertRaises(IndexError):
            popfcn(ul, self.limit)
        with self.assertRaises(IndexError):
            popfcn(ul, -1 - self.limit) </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(IndexError, ul._checkindex, i)
 </s> add             with self.assertRaises(IndexError):
                ul._checkindex(i) </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, indexfcn, ul, 40)
        self.assertRaises(ValueError, removefcn, ul, 40)
 </s> add         with self.assertRaises(ValueError):
            indexfcn(ul, 40)
        with self.assertRaises(ValueError):
            removefcn(ul, 40)
            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)
          def delfcn(x, i):
              del x[i]
          pl, ul = self.lists_of_len()
          for i in (-1 - self.limit, self.limit):
            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(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(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)
  
      def test06_list_methods(self):
          'List methods'
          pl, ul = self.lists_of_len()
          pl.append(40)
keep keep keep keep replace 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