[Python-Dev] Failing tests: marshal, warnings (original) (raw)
Brett C. bac at OCF.Berkeley.EDU
Mon Mar 7 02:14:22 CET 2005
- Previous message: [Python-Dev] Failing tests: marshal, warnings
- Next message: [Python-Dev] Failing tests: marshal, warnings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Greg Ward wrote: [SNIP]
A-ha! I get it. There are two mistakes in testdescr.py:testinit(): lack of "finally" clause, and failure to make a copy of warnings.filters. This patch fixes both:
""" --- Lib/test/testdescr.py 4 Mar 2005 04:47:04 -0000 1.202.2.2 +++ Lib/test/testdescr.py 7 Mar 2005 00:54:00 -0000 @@ -3973,15 +3973,18 @@ def init(self): return 10 - oldfilters = warnings.filters - warnings.filterwarnings("error", category=RuntimeWarning) + oldfilters = warnings.filters[:] try: - Foo() - except RuntimeWarning: pass - else: - raise TestFailed, "did not test init() for None return" - warnings.filters = oldfilters + warnings.filterwarnings("error", category=RuntimeWarning) + try: + Foo() + except RuntimeWarning: + pass + else: + raise TestFailed, "did not test init() for None return" + finally: + warnings.filters = oldfilters
def testmain(): """ I'll check this in and merge to the trunk once I see all tests passing.
Well, I just checked in the list copy fix, so you only have to worry about adding the 'finally' clause to the 'try' statement.
-Brett
- Previous message: [Python-Dev] Failing tests: marshal, warnings
- Next message: [Python-Dev] Failing tests: marshal, warnings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]