Skip to content

Commit 2f281f9

Browse files
committed
same for _testinternalcapi
1 parent ee59233 commit 2f281f9

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Lib/test/test_monitoring.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import test.support
1515
from test.support import import_helper, requires_specialization, script_helper
1616

17-
_testinternalcapi = import_helper.import_module("_testinternalcapi")
18-
1917
PAIR = (0,1)
2018

2119
def f1():
@@ -866,6 +864,8 @@ def test_implicit_stop_iteration(self):
866864
This test checks that both paths record an equivalent event.
867865
"""
868866

867+
_testinternalcapi = import_helper.import_module("_testinternalcapi")
868+
869869
def gen():
870870
yield 1
871871
return 2
@@ -1033,6 +1033,8 @@ def func():
10331033

10341034
@requires_specialization
10351035
def test_no_unwind_for_shim_frame(self):
1036+
_testinternalcapi = import_helper.import_module("_testinternalcapi")
1037+
10361038
class ValueErrorRaiser:
10371039
def __init__(self):
10381040
raise ValueError()
@@ -2454,6 +2456,7 @@ def run():
24542456
sys.monitoring.set_events(TEST_TOOL, 0)
24552457

24562458
def test_108390(self):
2459+
_testinternalcapi = import_helper.import_module("_testinternalcapi")
24572460

24582461
class Foo:
24592462
def __init__(self, set_event):
@@ -2545,6 +2548,8 @@ def test_func(x):
25452548
class TestTier2Optimizer(CheckEvents):
25462549

25472550
def test_monitoring_already_opimized_loop(self):
2551+
_testinternalcapi = import_helper.import_module("_testinternalcapi")
2552+
25482553
def test_func(recorder):
25492554
set_events = sys.monitoring.set_events
25502555
line = E.LINE

0 commit comments

Comments
 (0)