          def build_no_cbc():
              class TooManyBases(Person, Abstract):
                  class Meta:
                      proxy = True
          self.assertRaises(TypeError, build_no_cbc)
  
      @isolate_apps('proxy_models')
      def test_no_base_classes(self):
          def build_no_base_classes():
              class NoBaseClasses(models.Model):
 
</s> remove         self.assertRaises(TypeError, build_no_base_classes)
 </s> add         with self.assertRaises(TypeError):
            build_no_base_classes() </s> remove         self.assertRaises(TypeError, build_abc)
 </s> add         with self.assertRaises(TypeError):
            build_abc() </s> remove         self.assertRaises(ValueError, ModelFormMetaclass, str('Form'), (ModelForm,), {'Meta': Meta})
 </s> add         with self.assertRaises(ValueError):
            ModelFormMetaclass(str('Form'), (ModelForm,), {'Meta': Meta}) </s> remove         self.assertRaises(PermissionDenied, AView.as_view(), request)
 </s> add         with self.assertRaises(PermissionDenied):
            AView.as_view()(request) </s> remove         self.assertRaises(NotImplementedError, lambda: A().do)
 </s> add         with self.assertRaises(NotImplementedError):
            A().do
        with self.assertRaises(TypeError):
            build_no_cbc()
          def build_no_cbc():
              class TooManyBases(Person, Abstract):
                  class Meta:
                      proxy = True
        with self.assertRaises(TypeError):
            build_no_cbc()
  
      @isolate_apps('proxy_models')
      def test_no_base_classes(self):
          def build_no_base_classes():
              class NoBaseClasses(models.Model):
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/proxy_models/tests.py