mirror of
https://github.com/python/cpython.git
synced 2025-12-08 02:08:20 +00:00
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.
This commit is contained in:
parent
154c08894b
commit
7633d2393f
1 changed files with 4 additions and 5 deletions
|
|
@ -10,6 +10,10 @@ import warnings
|
||||||
import unittest
|
import unittest
|
||||||
from test import test_support
|
from test import test_support
|
||||||
|
|
||||||
|
warnings.filterwarnings("ignore",
|
||||||
|
category=RuntimeWarning,
|
||||||
|
message="mktemp", module=__name__)
|
||||||
|
|
||||||
if hasattr(os, 'stat'):
|
if hasattr(os, 'stat'):
|
||||||
import stat
|
import stat
|
||||||
has_stat = 1
|
has_stat = 1
|
||||||
|
|
@ -478,16 +482,11 @@ class test_mktemp(TC):
|
||||||
# We must also suppress the RuntimeWarning it generates.
|
# We must also suppress the RuntimeWarning it generates.
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.dir = tempfile.mkdtemp()
|
self.dir = tempfile.mkdtemp()
|
||||||
warnings.filterwarnings("ignore",
|
|
||||||
category=RuntimeWarning,
|
|
||||||
message="mktemp")
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
if self.dir:
|
if self.dir:
|
||||||
os.rmdir(self.dir)
|
os.rmdir(self.dir)
|
||||||
self.dir = None
|
self.dir = None
|
||||||
# XXX This clobbers any -W options.
|
|
||||||
warnings.resetwarnings()
|
|
||||||
|
|
||||||
class mktemped:
|
class mktemped:
|
||||||
_unlink = os.unlink
|
_unlink = os.unlink
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue