diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-10 19:50:40 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-10 19:50:40 (GMT) |
commit | 074e5ed974be65fbcfe75a4c0529dbc53f13446f (patch) | |
tree | dc07f407c721cad3da8659ba173ce0c778bf59a9 /Lib/test/test_sys.py | |
parent | 434736a1a621f785858e58efe682320178de7993 (diff) | |
download | cpython-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.py | 15 |
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() |