Re: [pypy-dev] [pypy-commit] pypy win32-cleanup2: fix test, catching raised exception with 'raises' fails on win32
Hi Matti, On 04/08/2012 01:08 PM, mattip wrote:
Author: Matti Picus <matti.picus@gmail.com> Branch: win32-cleanup2 Changeset: r54246:36ff8218c07d Date: 2012-04-08 13:30 +0300 http://bitbucket.org/pypy/pypy/changeset/36ff8218c07d/
Log: fix test, catching raised exception with 'raises' fails on win32
diff --git a/pypy/module/_socket/test/test_sock_app.py b/pypy/module/_socket/test/test_sock_app.py --- a/pypy/module/_socket/test/test_sock_app.py +++ b/pypy/module/_socket/test/test_sock_app.py @@ -617,7 +617,10 @@ except timeout: pass # test sendall() timeout - raises(timeout, cli.sendall, 'foobar' * 70) + try: + cli.sendall('foobar'*70) + except: + pass
isn't it better to use a more precise "except"? The way it's written now the test would pass even if there is a typo. ciao, Anto
Hi Matti, On Sun, Apr 8, 2012 at 14:53, Antonio Cuni <anto.cuni@gmail.com> wrote:
- raises(timeout, cli.sendall, 'foobar' * 70) + try: + cli.sendall('foobar'*70) + except: + pass
isn't it better to use a more precise "except"? The way it's written now the test would pass even if there is a typo.
Why did you have to change it? It seems to me that the old way is precisely equivalent to "except timeout:", and I doubt it's some win32-specific issue. There must be another deeper issue. A bientôt, Armin.
participants (2)
-
Antonio Cuni -
Armin Rigo