Kaydet (Commit) c8d502ea authored tarafından Brett Cannon's avatar Brett Cannon

Fix the warnings usage in test_posix.

üst d3791ed4
...@@ -13,8 +13,6 @@ import shutil ...@@ -13,8 +13,6 @@ import shutil
import unittest import unittest
import warnings import warnings
warnings.filterwarnings('ignore', '.* potential security risk .*',
RuntimeWarning)
class PosixTester(unittest.TestCase): class PosixTester(unittest.TestCase):
...@@ -22,9 +20,14 @@ class PosixTester(unittest.TestCase): ...@@ -22,9 +20,14 @@ class PosixTester(unittest.TestCase):
# create empty file # create empty file
fp = open(support.TESTFN, 'w+') fp = open(support.TESTFN, 'w+')
fp.close() fp.close()
self._warnings_manager = support.check_warnings()
self._warnings_manager.__enter__()
warnings.filterwarnings('ignore', '.* potential security risk .*',
RuntimeWarning)
def tearDown(self): def tearDown(self):
support.unlink(support.TESTFN) support.unlink(support.TESTFN)
self._warnings_manager.__exit__(None, None, None)
def testNoArgFunctions(self): def testNoArgFunctions(self):
# test posix functions which take no arguments and have # test posix functions which take no arguments and have
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment