1414import test .support
1515from test .support import import_helper , requires_specialization_ft , script_helper
1616
17- # TODO: RUSTPYTHON - make _testcapi optional so other tests can run
18- try :
19- _testcapi = import_helper .import_module ("_testcapi" )
20- except unittest .SkipTest :
21- _testcapi = None
22- try :
23- _testinternalcapi = import_helper .import_module ("_testinternalcapi" )
24- except unittest .SkipTest :
25- _testinternalcapi = None
17+ _testcapi = import_helper .import_module ("_testcapi" )
18+ _testinternalcapi = import_helper .import_module ("_testinternalcapi" )
2619
2720PAIR = (0 ,1 )
2821
@@ -1235,6 +1228,7 @@ def func1():
12351228 ('instruction' , 'func1' , 16 ),
12361229 ('line' , 'get_events' , 11 )])
12371230
1231+ @unittest .expectedFailure # TODO: RUSTPYTHON; - instruction offsets differ from CPython
12381232 def test_c_call (self ):
12391233
12401234 def func2 ():
@@ -1260,6 +1254,7 @@ def func2():
12601254 ('instruction' , 'func2' , 46 ),
12611255 ('line' , 'get_events' , 11 )])
12621256
1257+ @unittest .expectedFailure # TODO: RUSTPYTHON; - instruction offsets differ from CPython
12631258 def test_try_except (self ):
12641259
12651260 def func3 ():
@@ -1557,6 +1552,7 @@ class BranchRightOffsetRecorder(JumpOffsetRecorder):
15571552class TestBranchAndJumpEvents (CheckEvents ):
15581553 maxDiff = None
15591554
1555+ @unittest .expectedFailure # TODO: RUSTPYTHON; - bytecode layout differs from CPython
15601556 def test_loop (self ):
15611557
15621558 def func ():
@@ -1622,6 +1618,7 @@ def whilefunc(n=0):
16221618 ('branch left' , 'func' , 44 , 50 ),
16231619 ('branch right' , 'func' , 28 , 70 )])
16241620
1621+ @unittest .expectedFailure # TODO: RUSTPYTHON; - bytecode layout differs from CPython
16251622 def test_except_star (self ):
16261623
16271624 class Foo :
@@ -1667,6 +1664,7 @@ def func():
16671664 ('return' , 'func' , None ),
16681665 ('line' , 'get_events' , 11 )])
16691666
1667+ @unittest .expectedFailure # TODO: RUSTPYTHON; - bytecode layout differs from CPython
16701668 def test_while_offset_consistency (self ):
16711669
16721670 def foo (n = 0 ):
@@ -1684,6 +1682,7 @@ def foo(n=0):
16841682 in_loop ,
16851683 exit_loop ])
16861684
1685+ @unittest .expectedFailure # TODO: RUSTPYTHON; - bytecode layout differs from CPython
16871686 def test_async_for (self ):
16881687
16891688 def func ():
@@ -1708,6 +1707,7 @@ async def foo():
17081707 ('branch left' , 'func' , 12 , 12 )])
17091708
17101709
1710+ @unittest .expectedFailure # TODO: RUSTPYTHON; - bytecode layout differs from CPython
17111711 def test_match (self ):
17121712
17131713 def func (v = 1 ):
@@ -2248,6 +2248,7 @@ def test_func(recorder):
22482248
22492249class TestMonitoringAtShutdown (unittest .TestCase ):
22502250
2251+ @unittest .expectedFailure # TODO: RUSTPYTHON; - requires subprocess support
22512252 def test_monitoring_live_at_shutdown (self ):
22522253 # gh-115832: An object destructor running during the final GC of
22532254 # interpreter shutdown triggered an infinite loop in the
@@ -2256,7 +2257,6 @@ def test_monitoring_live_at_shutdown(self):
22562257 script_helper .run_test_script (script )
22572258
22582259
2259- @unittest .skipIf (_testcapi is None , "requires _testcapi" ) # TODO: RUSTPYTHON
22602260class TestCApiEventGeneration (MonitoringTestBase , unittest .TestCase ):
22612261
22622262 class Scope :
0 commit comments