          self.assertEqual(10, f.clean(10, None))
  
      def test_nullable_integerfield_raises_error_with_blank_false(self):
          f = models.IntegerField(null=True, blank=False)
          self.assertRaises(ValidationError, f.clean, None, None)
  
      def test_nullable_integerfield_cleans_none_on_null_and_blank_true(self):
          f = models.IntegerField(null=True, blank=True)
          self.assertIsNone(f.clean(None, None))
  
 
</s> remove         self.assertRaises(ValidationError, f.clean, None, None)
        self.assertRaises(ValidationError, f.clean, '', None)
 </s> add         with self.assertRaises(ValidationError):
            f.clean(None, None)
        with self.assertRaises(ValidationError):
            f.clean('', None) </s> remove         self.assertRaises(ValidationError, f.clean, None, None)
 </s> add         with self.assertRaises(ValidationError):
            f.clean(None, None) </s> remove         self.assertRaises(ValidationError, f.clean, "a", None)
 </s> add         with self.assertRaises(ValidationError):
            f.clean("a", None) </s> remove         self.assertRaises(ValidationError, f.clean, "", None)
 </s> add         with self.assertRaises(ValidationError):
            f.clean("", None) </s> remove         self.assertRaises(ValidationError, f.clean, None, None)
 </s> add         with self.assertRaises(ValidationError):
            f.clean(None, None)
        with self.assertRaises(ValidationError):
            f.clean(None, None)
          self.assertEqual(10, f.clean(10, None))
  
      def test_nullable_integerfield_raises_error_with_blank_false(self):
          f = models.IntegerField(null=True, blank=False)
        with self.assertRaises(ValidationError):
            f.clean(None, None)
  
      def test_nullable_integerfield_cleans_none_on_null_and_blank_true(self):
          f = models.IntegerField(null=True, blank=True)
          self.assertIsNone(f.clean(None, None))
  
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/model_fields/tests.py