  
  class UtilsTests(SimpleTestCase):
  
      def test_no_existent_external_program(self):
          self.assertRaises(CommandError, popen_wrapper, ['a_42_command_that_doesnt_exist_42'])
 
</s> remove         self.assertRaises(CommandError, call_command, 'check', tags=['missingtag'])
 </s> add         with self.assertRaises(CommandError):
            call_command('check', tags=['missingtag']) </s> remove         self.assertRaises(TypeError, build_no_cbc)
 </s> add         with self.assertRaises(TypeError):
            build_no_cbc() </s> remove         self.assertRaises(CommandError, management.call_command, ('explode',))
 </s> add         with self.assertRaises(CommandError):
            management.call_command(('explode',)) </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()
        with self.assertRaises(CommandError):
            popen_wrapper(['a_42_command_that_doesnt_exist_42'])
  
  class UtilsTests(SimpleTestCase):
  
      def test_no_existent_external_program(self):
        with self.assertRaises(CommandError):
            popen_wrapper(['a_42_command_that_doesnt_exist_42'])
keep keep keep keep replace
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/user_commands/tests.py