[Python-checkins] Improve renamed test_run.RecursionLimitTest (GH-21794)
Miss Islington (bot)
webhook-mailer at python.org
Sun Aug 9 13:36:03 EDT 2020
https://github.com/python/cpython/commit/692552388d0d89523416eac24f436dafa2bb4914
commit: 692552388d0d89523416eac24f436dafa2bb4914
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-08-09T10:35:59-07:00
summary:
Improve renamed test_run.RecursionLimitTest (GH-21794)
PEP 8 style and new comments.
(cherry picked from commit 8b67bf907c51846853127176cbb2982d102a2c2d)
Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>
files:
M Lib/idlelib/idle_test/test_run.py
diff --git a/Lib/idlelib/idle_test/test_run.py b/Lib/idlelib/idle_test/test_run.py
index 9995dbe2eca50..e2bdf1cfee352 100644
--- a/Lib/idlelib/idle_test/test_run.py
+++ b/Lib/idlelib/idle_test/test_run.py
@@ -282,7 +282,8 @@ def test_close(self):
self.assertRaises(TypeError, f.close, 1)
-class TestSysRecursionLimitWrappers(unittest.TestCase):
+class RecursionLimitTest(unittest.TestCase):
+ # Test (un)install_recursionlimit_wrappers and fixdoc.
def test_bad_setrecursionlimit_calls(self):
run.install_recursionlimit_wrappers()
@@ -296,12 +297,12 @@ def test_roundtrip(self):
run.install_recursionlimit_wrappers()
self.addCleanup(run.uninstall_recursionlimit_wrappers)
- # check that setting the recursion limit works
+ # Check that setting the recursion limit works.
orig_reclimit = sys.getrecursionlimit()
self.addCleanup(sys.setrecursionlimit, orig_reclimit)
sys.setrecursionlimit(orig_reclimit + 3)
- # check that the new limit is returned by sys.getrecursionlimit()
+ # Check that the new limit is returned by sys.getrecursionlimit().
new_reclimit = sys.getrecursionlimit()
self.assertEqual(new_reclimit, orig_reclimit + 3)
@@ -313,6 +314,7 @@ def test_default_recursion_limit_preserved(self):
self.assertEqual(new_reclimit, orig_reclimit)
def test_fixdoc(self):
+ # Put here until better place for miscellaneous test.
def func(): "docstring"
run.fixdoc(func, "more")
self.assertEqual(func.__doc__, "docstring\n\nmore")
More information about the Python-checkins
mailing list