mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-118761: Add test_lazy_import for more modules (#133057)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
b1aa515bd6
commit
cae660d6dc
20 changed files with 139 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
|
||||
from test import support
|
||||
from test.support.import_helper import ensure_lazy_imports
|
||||
from io import StringIO
|
||||
from pstats import SortKey
|
||||
from enum import StrEnum, _test_simple_enum
|
||||
|
@ -10,6 +11,12 @@ import pstats
|
|||
import tempfile
|
||||
import cProfile
|
||||
|
||||
class LazyImportTest(unittest.TestCase):
|
||||
@support.cpython_only
|
||||
def test_lazy_import(self):
|
||||
ensure_lazy_imports("pstats", {"typing"})
|
||||
|
||||
|
||||
class AddCallersTestCase(unittest.TestCase):
|
||||
"""Tests for pstats.add_callers helper."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue