summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-10-17 22:09:03 (GMT)
committerFred Drake <fdrake@acm.org>2002-10-17 22:09:03 (GMT)
commit7633d2393f8b0b8a6b3480799dc35cfc954069a6 (patch)
tree46fb4ed3999f0c05f16bac343633986b1f5f9493 /Lib/test
parent154c08894b9003671c92af751b3b889808e43e1c (diff)
downloadcpython-7633d2393f8b0b8a6b3480799dc35cfc954069a6.zip
cpython-7633d2393f8b0b8a6b3480799dc35cfc954069a6.tar.gz
cpython-7633d2393f8b0b8a6b3480799dc35cfc954069a6.tar.bz2
Don't call warnings.resetwarnings(); that does bad things that cause
other tests to generate warning when they didn't before. In particular, this cancels not only filters set by -W, but also from test.regrtest.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_tempfile.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index 0f5ce9f..cb95724 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -10,6 +10,10 @@ import warnings
import unittest
from test import test_support
+warnings.filterwarnings("ignore",
+ category=RuntimeWarning,
+ message="mktemp", module=__name__)
+
if hasattr(os, 'stat'):
import stat
has_stat = 1
@@ -478,16 +482,11 @@ class test_mktemp(TC):
# We must also suppress the RuntimeWarning it generates.
def setUp(self):
self.dir = tempfile.mkdtemp()
- warnings.filterwarnings("ignore",
- category=RuntimeWarning,
- message="mktemp")
def tearDown(self):
if self.dir:
os.rmdir(self.dir)
self.dir = None
- # XXX This clobbers any -W options.
- warnings.resetwarnings()
class mktemped:
_unlink = os.unlink