aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_curses.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-10-31 03:14:01 -0700
committerGitHub <noreply@github.com>2017-10-31 03:14:01 -0700
commit19f68301a1295a9c30d9f28b8f1479cdcccd75aa (patch)
treea1bbb67d9c9f3e30171637699e1e165c6fd43513 /Lib/test/test_curses.py
parentf0f62cc61ec8c6b7b70470beadbab64eb23e6a5d (diff)
downloadcpython-19f68301a1295a9c30d9f28b8f1479cdcccd75aa.tar.gz
cpython-19f68301a1295a9c30d9f28b8f1479cdcccd75aa.zip
bpo-31629: Add support.SaveSignals (#4183)
test_curses now saves/restores signals. On FreeBSD, the curses module sets handlers of some signals, but don't restore old handlers when the module is deinitialized.
Diffstat (limited to 'Lib/test/test_curses.py')
-rw-r--r--Lib/test/test_curses.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index 0d0b160d764..b0a28908da7 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -15,7 +15,7 @@ import sys
import tempfile
import unittest
-from test.support import requires, import_module, verbose
+from test.support import requires, import_module, verbose, SaveSignals
# Optionally test curses module. This currently requires that the
# 'curses' resource be given on the regrtest command line using the -u
@@ -63,6 +63,8 @@ class TestCurses(unittest.TestCase):
del cls.tmp
def setUp(self):
+ self.save_signals = SaveSignals()
+ self.save_signals.save()
if verbose:
# just to make the test output a little more readable
print()
@@ -72,6 +74,7 @@ class TestCurses(unittest.TestCase):
def tearDown(self):
curses.resetty()
curses.endwin()
+ self.save_signals.restore()
def test_window_funcs(self):
"Test the methods of windows"