Author: Armin Rigo <ar...@tunes.org> Branch: py3.5 Changeset: r87794:b24bc29f15b7 Date: 2016-10-14 16:38 +0200 http://bitbucket.org/pypy/pypy/changeset/b24bc29f15b7/
Log: Fix test diff --git a/pypy/objspace/std/test/test_newformat.py b/pypy/objspace/std/test/test_newformat.py --- a/pypy/objspace/std/test/test_newformat.py +++ b/pypy/objspace/std/test/test_newformat.py @@ -149,22 +149,13 @@ assert self.s("{0:d}").format(G("data")) == "G(data)" assert self.s("{0!s}").format(G("data")) == "string is data" - msg = "object.__format__ with a non-empty format string is deprecated", - with warnings.catch_warnings(record=True) as log: - # This is ok because warnings.catch_warnings resets the filters - warnings.simplefilter("always", DeprecationWarning) - assert self.s("{0:^10}").format(E("data")) == " E(data) " - assert log[0].message.args == msg - assert type(log[0].message) is DeprecationWarning - - assert self.s("{0:^10s}").format(E("data")) == " E(data) " - assert log[1].message.args == msg - assert type(log[1].message) is DeprecationWarning - - assert self.s("{0:>15s}").format(G("data")) == " string is data" - assert log[2].message.args == msg - assert type(log[2].message) is DeprecationWarning - assert len(log) == 3 + msg = "non-empty format string passed to object.__format__" + e = raises(TypeError, self.s("{0:^10}").format, E("data")) + assert str(e.value) == msg + e = raises(TypeError, self.s("{0:^10s}").format, E("data")) + assert str(e.value) == msg + e = raises(TypeError, self.s("{0:>15s}").format, G("data")) + assert str(e.value) == msg def test_bogus_cases(self): raises(KeyError, '{0]}'.format, 5) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit