

def test_missing_required(self):
    cmd = commands.Command()
    cmd.add_argument('--bar', required=True)
    with self.assertRaises(SystemExit):
        cmd.parse([], prog='foo')
    self.exit_mock.assert_called_once_with(1, 'argument --bar is required', 'usage: foo --bar BAR')

dataset/ETHPy150Open mopidy/mopidy/tests/test_commands.py CommandParsingTest.test_missing_required/original