diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2021-09-15 16:19:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-15 16:19:30 (GMT) |
commit | cbeb81971057d6c382f45ecce92df2b204d4106a (patch) | |
tree | 98b66700b6ca5d81c863eb0b72bee6e8e38d91ca /Lib/test/test_pydoc.py | |
parent | 1a9ef5798525bbb39a16c8af5c435b97352ee027 (diff) | |
download | cpython-cbeb81971057d6c382f45ecce92df2b204d4106a.zip cpython-cbeb81971057d6c382f45ecce92df2b204d4106a.tar.gz cpython-cbeb81971057d6c382f45ecce92df2b204d4106a.tar.bz2 |
bpo-45020: Freeze some of the modules imported during startup. (gh-28335)
Doing this provides significant performance gains for runtime startup (~15% with all the imported modules frozen). We don't yet freeze all the imported modules because there are a few hiccups in the build systems we need to sort out first. (See bpo-45186 and bpo-45188.)
Note that in PR GH-28320 we added a command-line flag (-X frozen_modules=[on|off]) that allows users to opt out of (or into) using frozen modules. The default is still "off" but we will change it to "on" as soon as we can do it in a way that does not cause contributors pain.
https://bugs.python.org/issue45020
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 80a09a9..a952ab9 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -23,6 +23,7 @@ import xml.etree.ElementTree import textwrap from io import StringIO from collections import namedtuple +from test.support import import_helper from test.support import os_helper from test.support.script_helper import assert_python_ok, assert_python_failure from test.support import threading_helper @@ -728,6 +729,7 @@ class PydocDocTest(unittest.TestCase): @unittest.skipIf(sys.flags.optimize >= 2, 'Docstrings are omitted with -OO and above') def test_synopsis_sourceless(self): + os = import_helper.import_fresh_module('os') expected = os.__doc__.splitlines()[0] filename = os.__cached__ synopsis = pydoc.synopsis(filename) |