Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r54456:f4cd131f5c40 Date: 2012-04-17 11:30 +0200 http://bitbucket.org/pypy/pypy/changeset/f4cd131f5c40/
Log: Check that we get the exact exception raised, not an unrelated TypeError. diff --git a/pypy/objspace/test/test_descroperation.py b/pypy/objspace/test/test_descroperation.py --- a/pypy/objspace/test/test_descroperation.py +++ b/pypy/objspace/test/test_descroperation.py @@ -707,14 +707,16 @@ res = 'bar' in x assert res is True # + class MyError(Exception): + pass class CannotConvertToBool(object): def __nonzero__(self): - raise TypeError + raise MyError class X(object): def __contains__(self, item): return CannotConvertToBool() x = X() - raises(TypeError, "'foo' in x") + raises(MyError, "'foo' in x") _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit