This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix test discovery for test_warnings
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: berker.peksag, brett.cannon, ezio.melotti, python-dev, zach.ware
Priority: normal Keywords: patch

Created on 2013-01-09 11:13 by berker.peksag, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_warnings_discovery.diff berker.peksag, 2013-01-09 11:13 review
Messages (3)
msg179464 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-01-09 16:05
Patch looks good to me.  Thank you, Berker!
msg179520 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-01-10 04:55
New changeset 20e44464eb86 by Ezio Melotti in branch '3.3':
#16905: test_bufio now works with unittest test discovery.  Initial patch by Berker Peksag.
http://hg.python.org/cpython/rev/20e44464eb86

New changeset 6ee721029fd5 by Ezio Melotti in branch 'default':
#16905: merge with 3.3.
http://hg.python.org/cpython/rev/6ee721029fd5
msg179521 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-01-10 05:00
Fixed, thanks for the patch!
However I had to change a couple of things:
1) test_main contained c/py_warnings.onceregistry.clear(), and removing that breaks when running the test twice in a row.  I now added it to setUpModule, and that seems to be called both when the tests are run via regrtest and also when they are run via unittest.
2) Since the onceregistry wasn't cleared at the end of the tests, I also added a tearDownModule to take care of it.
3) I reorganized a bit the inheritance trees of the classes because they were inconsistent.  Now all the tests use BaseTest -> TestFoo(BaseTest) -> C/PyTestFoo(TestFoo, Unittest).  Previously some of the tests used BaseTest | TestFoo -> C/PyTestFoo(BaseTest, TestFoo, Unittest).
History
Date User Action Args
2022-04-11 14:57:40adminsetgithub: 61109
2013-01-10 05:00:41ezio.melottisetstatus: open -> closed
messages: + msg179521

assignee: ezio.melotti
resolution: fixed
stage: resolved
2013-01-10 04:55:12python-devsetnosy: + python-dev
messages: + msg179520
2013-01-09 16:05:18zach.waresetmessages: + msg179464
2013-01-09 11:13:37berker.peksagcreate