Zachary Ware added the comment:
I considered doing a test like that, but figured it was pretty well covered by
the assert_python_ok no-arg test. On the other hand, it looks like we document
that the default value of SystemExit().code is None, so it should be tested.
I'll add it in.
Thanks,
Roundup Robot added the comment:
New changeset 63f0a1e95d2b by Zachary Ware in branch '2.7':
Issue #20510: Rewrote test_exit in test_sys to match existing comments
http://hg.python.org/cpython/rev/63f0a1e95d2b
New changeset fa81f6ddd60e by Zachary Ware in branch '3.3':
Issue #20510: Rewrote
Zachary Ware added the comment:
Fixed, thanks for the report and patch!
And btw, you are right to avoid while we're in there changes in general, but
modernizing the test suite gets a little bit of leniency in that regard. It
wouldn't have been appropriate to venture outside of test_exit in
Serhiy Storchaka added the comment:
What about following test?
with self.assertRaises(SystemExit) as cm:
sys.exit()
self.assertIsNone(cm.exception.code)
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
Zachary Ware added the comment:
The newer patch looks good to me, I'll get it committed as soon as I can test
it. Thanks!
--
assignee: - zach.ware
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20510
New submission from Gareth Rees:
Lib/test/test_sys.py contains test cases with incorrect comments -- or
comments with incorrect test cases, if you prefer:
# call without argument
try:
sys.exit(0)
except SystemExit as exc:
self.assertEqual(exc.code, 0)
...
#
Changes by Zachary Ware zachary.w...@gmail.com:
--
nosy: +zach.ware
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20510
___
___
Python-bugs-list
Zachary Ware added the comment:
Good catch! See my review comments.
Also, if you haven't already, could you please sign a contributor's agreement?
See http://www.python.org/psf/contrib/.
--
stage: - patch review
versions: +Python 2.7, Python 3.3
Gareth Rees added the comment:
I normally try not to make changes while we're in here for fear of
introducing errors! But I guess the test cases are less critical, so
I've taken your review comments as a license to submit a revised patch
that:
* incorporates your suggestion to use