summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-11-10 19:50:40 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-11-10 19:50:40 (GMT)
commit074e5ed974be65fbcfe75a4c0529dbc53f13446f (patch)
treedc07f407c721cad3da8659ba173ce0c778bf59a9 /Lib/test/test_sys.py
parent434736a1a621f785858e58efe682320178de7993 (diff)
downloadcpython-074e5ed974be65fbcfe75a4c0529dbc53f13446f.zip
cpython-074e5ed974be65fbcfe75a4c0529dbc53f13446f.tar.gz
cpython-074e5ed974be65fbcfe75a4c0529dbc53f13446f.tar.bz2
Merge in the new GIL.
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r--Lib/test/test_sys.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index d297870..4a08ba8 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -154,6 +154,21 @@ class SysModuleTest(unittest.TestCase):
sys.setcheckinterval(n)
self.assertEquals(sys.getcheckinterval(), n)
+ def test_switchinterval(self):
+ self.assertRaises(TypeError, sys.setswitchinterval)
+ self.assertRaises(TypeError, sys.setswitchinterval, "a")
+ self.assertRaises(ValueError, sys.setswitchinterval, -1.0)
+ self.assertRaises(ValueError, sys.setswitchinterval, 0.0)
+ orig = sys.getswitchinterval()
+ # sanity check
+ self.assertTrue(orig < 0.5, orig)
+ try:
+ for n in 0.00001, 0.05, 3.0, orig:
+ sys.setswitchinterval(n)
+ self.assertAlmostEquals(sys.getswitchinterval(), n)
+ finally:
+ sys.setswitchinterval(orig)
+
def test_recursionlimit(self):
self.assertRaises(TypeError, sys.getrecursionlimit, 42)
oldlimit = sys.getrecursionlimit()