From: Armin Ronacher Date: Sat, 6 Jul 2013 14:49:29 +0000 (+0200) Subject: Some small fixes from #19 X-Git-Tag: 1.0~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28c74232f2ff0a50e6932c0e207b6f3f2ac33121;p=thirdparty%2Fbabel.git Some small fixes from #19 --- diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py index 88315fbc..9cce4b72 100644 --- a/tests/messages/test_frontend.py +++ b/tests/messages/test_frontend.py @@ -733,7 +733,7 @@ pybabel: error: no valid command or option passed. try the -h/--help option for 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] diff --git a/tests/test_core.py b/tests/test_core.py index 9341ca8b..224ebc83 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -233,7 +233,7 @@ def test_parse_locale(): 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) diff --git a/tests/test_numbers.py b/tests/test_numbers.py index 9a0caf2d..718ed69d 100644 --- a/tests/test_numbers.py +++ b/tests/test_numbers.py @@ -247,7 +247,7 @@ def test_parse_number(): 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(): @@ -257,7 +257,7 @@ 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():