Skip to content

Commit 0d5efb7

Browse files
committed
Add regression test
1 parent 9910cfd commit 0d5efb7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Lib/test/test_dataclasses/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,21 @@
2727
import dataclasses # Needed for the string "dataclasses.InitVar[int]" to work as an annotation.
2828

2929
from test import support
30-
from test.support import import_helper
30+
from test.support import cpython_only, import_helper
3131

3232
# Just any custom exception we can catch.
3333
class CustomError(Exception): pass
3434

35+
36+
class TestImportTime(unittest.TestCase):
37+
38+
@cpython_only
39+
def test_lazy_import(self):
40+
import_helper.ensure_lazy_imports(
41+
"dataclasses", {"inspect"}
42+
)
43+
44+
3545
class TestCase(unittest.TestCase):
3646
def test_no_fields(self):
3747
@dataclass

0 commit comments

Comments
 (0)