mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
gh-118761: Improve import time of tomllib
(#128907)
Improve import time of `tomllib` (in sync with upstream)
This commit is contained in:
parent
c879de71eb
commit
ea6cc26e75
4 changed files with 35 additions and 14 deletions
|
@ -5,6 +5,7 @@
|
|||
import copy
|
||||
import datetime
|
||||
from decimal import Decimal as D
|
||||
import importlib
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import tempfile
|
||||
|
@ -113,3 +114,11 @@ class TestMiscellaneous(unittest.TestCase):
|
|||
nest_count=nest_count):
|
||||
recursive_table_toml = nest_count * "key = {" + nest_count * "}"
|
||||
tomllib.loads(recursive_table_toml)
|
||||
|
||||
def test_types_import(self):
|
||||
"""Test that `_types` module runs.
|
||||
|
||||
The module is for type annotations only, so it is otherwise
|
||||
never imported by tests.
|
||||
"""
|
||||
importlib.import_module(f"{tomllib.__name__}._types")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue