

def test_invalid_type(self):
    cmd = commands.Command()
    cmd.add_argument('--bar', type=int)
    with self.assertRaises(SystemExit):
        cmd.parse(['--bar', b'zero'], prog='foo')
    self.exit_mock.assert_called_once_with(1, "argument --bar: invalid int value: 'zero'", 'usage: foo [--bar BAR]')

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