try:
self.cli.run(sys.argv + ['--help'])
self.fail('Expected SystemExit')
- except SystemExit, e:
+ except SystemExit as e:
self.assertEqual(0, e.code)
self.assertEqual("""\
usage: pybabel command [options] [args]
with pytest.raises(ValueError) as excinfo:
core.parse_locale('not_a_LOCALE_String')
- assert (excinfo.value.message ==
+ assert (excinfo.value.args[0] ==
"'not_a_LOCALE_String' is not a valid locale identifier")
assert core.parse_locale('it_IT@euro') == ('it', 'IT', None, None)
with pytest.raises(numbers.NumberFormatError) as excinfo:
numbers.parse_number('1.099,98', locale='de')
- assert excinfo.value.message == "'1.099,98' is not a valid number"
+ assert excinfo.value.args[0] == "'1.099,98' is not a valid number"
def test_parse_decimal():
with pytest.raises(numbers.NumberFormatError) as excinfo:
numbers.parse_decimal('2,109,998', locale='de')
- assert excinfo.value.message == "'2,109,998' is not a valid decimal number"
+ assert excinfo.value.args[0] == "'2,109,998' is not a valid decimal number"
def test_bankersround():