Issue 8414: Add test cases for assert (original ) (raw )Created on 2010-04-16 01:49 by gnofi , last changed 2022-04-11 14:56 by admin . This issue is now closed .
Messages (6)
msg103284 - (view)
Author: Gregory Nofi (gnofi)
Date: 2010-04-16 01:49
I'm adding some assert tests to test_grammar.py to verify that the assert statement raises (or doesn't raise) an AssertionError properly. NOTE: I'm currently helping Dino port IronPython tests into CPython. This is part of that series.
msg103286 - (view)
Author: Benjamin Peterson (benjamin.peterson) *
Date: 2010-04-16 02:54
I propose you move all the assert test cases into there own test method and decorate it with @unittest.skipUnless(__debug__).
msg103287 - (view)
Author: Ezio Melotti (ezio.melotti) *
Date: 2010-04-16 02:57
Wouldn't it be better to test e.args instead or in addition to str(e)? Skipping the whole test if __debug__ is False is also a good idea.
msg103925 - (view)
Author: Gregory Nofi (gnofi)
Date: 2010-04-21 23:56
I've uploaded new versions of the patch. __debug__: I removed the "if __debug__" clause and switched to skipUnless. Exception args: I replaced str(e) with e.args. Thanks for pointing that out! I had thought args was going to be deprecated but I guess it's not (Issue6777 ).
msg148756 - (view)
Author: Roundup Robot (python-dev)
Date: 2011-12-02 16:24
New changeset bcfb499338c1 by Ezio Melotti in branch '2.7': #8414 : add more tests for "assert". Initial patch by Gregory Nofi. http://hg.python.org/cpython/rev/bcfb499338c1 New changeset 1efefeda00a7 by Ezio Melotti in branch '3.2': #8414 : add more tests for "assert". Initial patch by Gregory Nofi. http://hg.python.org/cpython/rev/1efefeda00a7 New changeset 47afbb2033aa by Ezio Melotti in branch 'default': #8414 : merge with 3.2. http://hg.python.org/cpython/rev/47afbb2033aa
msg148757 - (view)
Author: Ezio Melotti (ezio.melotti) *
Date: 2011-12-02 16:26
Committed, thanks for the patch! I preferred to add a separate test, because only the tests with "assert False" need to be skipped with -O, the other can run with and without -O.
History
Date
User
Action
Args
2022-04-11 14:56:59
admin
set
github: 52661
2011-12-02 16:26:35
ezio.melotti
set
status: open -> closedversions: + Python 3.3messages: + assignee: ezio.melotti resolution: fixedstage: patch review -> resolved
2011-12-02 16:24:06
python-dev
set
nosy: + python-dev messages: +
2010-04-21 23:56:54
gnofi
set
files: + test_grammar.v3.patch
2010-04-21 23:56:31
gnofi
set
files: + test_grammar.v2.patch messages: +
2010-04-16 02:57:04
ezio.melotti
set
priority: normalnosy: + ezio.melotti messages: + stage: patch review
2010-04-16 02:54:28
benjamin.peterson
set
nosy: + benjamin.peterson messages: +
2010-04-16 01:49:28
gnofi
set
files: + test_grammar.v3.patch
2010-04-16 01:49:12
gnofi
create