summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2010-03-20 21:53:28 (GMT)
committerBrett Cannon <bcannon@gmail.com>2010-03-20 21:53:28 (GMT)
commitc8d502eab736c9167fcf4cde76a59caafd617eb8 (patch)
tree6a05803cccb41aa5f372077dd65734fd233da36f /Lib
parentd3791ed4502c4f73a2c1714fa59a541ddc605e89 (diff)
downloadcpython-c8d502eab736c9167fcf4cde76a59caafd617eb8.zip
cpython-c8d502eab736c9167fcf4cde76a59caafd617eb8.tar.gz
cpython-c8d502eab736c9167fcf4cde76a59caafd617eb8.tar.bz2
Fix the warnings usage in test_posix.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_posix.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 01cd044..fa1abe3 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -13,8 +13,6 @@ import shutil
import unittest
import warnings
-warnings.filterwarnings('ignore', '.* potential security risk .*',
- RuntimeWarning)
class PosixTester(unittest.TestCase):
@@ -22,9 +20,14 @@ class PosixTester(unittest.TestCase):
# create empty file
fp = open(support.TESTFN, 'w+')
fp.close()
+ self._warnings_manager = support.check_warnings()
+ self._warnings_manager.__enter__()
+ warnings.filterwarnings('ignore', '.* potential security risk .*',
+ RuntimeWarning)
def tearDown(self):
support.unlink(support.TESTFN)
+ self._warnings_manager.__exit__(None, None, None)
def testNoArgFunctions(self):
# test posix functions which take no arguments and have