@@ -138,7 +138,6 @@ def f(x):
138
138
def test_argument_order (self ):
139
139
self .assertRaises (SyntaxError , exec , 'def f(a=1, b): pass' )
140
140
141
- @unittest .skip ("TODO: RUSTPYTHON, thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseFloatError { kind: Invalid }'" )
142
141
def test_float_literals (self ):
143
142
# testing bad float literals
144
143
self .assertRaises (SyntaxError , eval , "2e" )
@@ -201,6 +200,8 @@ def test_literals_with_leading_zeroes(self):
201
200
self .assertEqual (eval ("0o777" ), 511 )
202
201
self .assertEqual (eval ("-0o0000010" ), - 8 )
203
202
203
+ # TODO: RUSTPYTHON
204
+ @unittest .expectedFailure
204
205
def test_int_literals_too_long (self ):
205
206
n = 3000
206
207
source = f"a = 1\n b = 2\n c = { '3' * n } \n d = 4"
@@ -274,6 +275,8 @@ def test_none_assignment(self):
274
275
self .assertRaises (SyntaxError , compile , stmt , 'tmp' , 'single' )
275
276
self .assertRaises (SyntaxError , compile , stmt , 'tmp' , 'exec' )
276
277
278
+ # TODO: RUSTPYTHON
279
+ @unittest .expectedFailure
277
280
def test_import (self ):
278
281
succeed = [
279
282
'import sys' ,
@@ -821,6 +824,8 @@ def continue_in_while():
821
824
self .assertEqual (None , opcodes [1 ].argval )
822
825
self .assertEqual ('RETURN_VALUE' , opcodes [2 ].opname )
823
826
827
+ # TODO: RUSTPYTHON
828
+ @unittest .expectedFailure
824
829
def test_consts_in_conditionals (self ):
825
830
def and_true (x ):
826
831
return True and x
@@ -844,6 +849,8 @@ def or_false(x):
844
849
self .assertIn ('LOAD_' , opcodes [- 2 ].opname )
845
850
self .assertEqual ('RETURN_VALUE' , opcodes [- 1 ].opname )
846
851
852
+ # TODO: RUSTPYTHON
853
+ @unittest .expectedFailure
847
854
def test_imported_load_method (self ):
848
855
sources = [
849
856
"""\
@@ -878,6 +885,8 @@ def foo(x):
878
885
self .assertIn ('LOAD_ATTR' , instructions )
879
886
self .assertIn ('PRECALL' , instructions )
880
887
888
+ # TODO: RUSTPYTHON
889
+ @unittest .expectedFailure
881
890
def test_lineno_procedure_call (self ):
882
891
def call ():
883
892
(
@@ -886,6 +895,8 @@ def call():
886
895
line1 = call .__code__ .co_firstlineno + 1
887
896
assert line1 not in [line for (_ , _ , line ) in call .__code__ .co_lines ()]
888
897
898
+ # TODO: RUSTPYTHON
899
+ @unittest .expectedFailure
889
900
def test_lineno_after_implicit_return (self ):
890
901
TRUE = True
891
902
# Don't use constant True or False, as compiler will remove test
@@ -920,6 +931,8 @@ def save_caller_frame():
920
931
func (save_caller_frame )
921
932
self .assertEqual (frame .f_lineno - frame .f_code .co_firstlineno , lastline )
922
933
934
+ # TODO: RUSTPYTHON
935
+ @unittest .expectedFailure
923
936
def test_lineno_after_no_code (self ):
924
937
def no_code1 ():
925
938
"doc string"
@@ -944,6 +957,8 @@ def get_code_lines(self, code):
944
957
last_line = line
945
958
return res
946
959
960
+ # TODO: RUSTPYTHON
961
+ @unittest .expectedFailure
947
962
def test_lineno_attribute (self ):
948
963
def load_attr ():
949
964
return (
@@ -988,6 +1003,8 @@ def aug_store_attr():
988
1003
code_lines = self .get_code_lines (func .__code__ )
989
1004
self .assertEqual (lines , code_lines )
990
1005
1006
+ # TODO: RUSTPYTHON
1007
+ @unittest .expectedFailure
991
1008
def test_line_number_genexp (self ):
992
1009
993
1010
def return_genexp ():
@@ -1002,6 +1019,8 @@ def return_genexp():
1002
1019
code_lines = self .get_code_lines (genexp_code )
1003
1020
self .assertEqual (genexp_lines , code_lines )
1004
1021
1022
+ # TODO: RUSTPYTHON
1023
+ @unittest .expectedFailure
1005
1024
def test_line_number_implicit_return_after_async_for (self ):
1006
1025
1007
1026
async def test (aseq ):
@@ -1022,6 +1041,8 @@ def test_big_dict_literal(self):
1022
1041
the_dict = "{" + "," .join (f"{ x } :{ x } " for x in range (dict_size )) + "}"
1023
1042
self .assertEqual (len (eval (the_dict )), dict_size )
1024
1043
1044
+ # TODO: RUSTPYTHON
1045
+ @unittest .expectedFailure
1025
1046
def test_redundant_jump_in_if_else_break (self ):
1026
1047
# Check if bytecode containing jumps that simply point to the next line
1027
1048
# is generated around if-else-break style structures. See bpo-42615.
@@ -1051,6 +1072,8 @@ def if_else_break():
1051
1072
elif instr .opname in HANDLED_JUMPS :
1052
1073
self .assertNotEqual (instr .arg , (line + 1 )* INSTR_SIZE )
1053
1074
1075
+ # TODO: RUSTPYTHON
1076
+ @unittest .expectedFailure
1054
1077
def test_no_wraparound_jump (self ):
1055
1078
# See https://bugs.python.org/issue46724
1056
1079
@@ -1061,6 +1084,8 @@ def while_not_chained(a, b, c):
1061
1084
for instr in dis .Bytecode (while_not_chained ):
1062
1085
self .assertNotEqual (instr .opname , "EXTENDED_ARG" )
1063
1086
1087
+ # TODO: RUSTPYTHON
1088
+ @unittest .expectedFailure
1064
1089
def test_compare_positions (self ):
1065
1090
for opname , op in [
1066
1091
("COMPARE_OP" , "<" ),
@@ -1361,64 +1386,66 @@ def check_stack_size(self, code):
1361
1386
max_size = math .ceil (math .log (len (code .co_code )))
1362
1387
self .assertLessEqual (code .co_stacksize , max_size )
1363
1388
1364
- # TODO: RUSTPYTHON
1365
- @unittest .expectedFailure
1366
1389
def test_and (self ):
1367
1390
self .check_stack_size ("x and " * self .N + "x" )
1368
1391
1369
- # TODO: RUSTPYTHON
1370
- @unittest .expectedFailure
1371
1392
def test_or (self ):
1372
1393
self .check_stack_size ("x or " * self .N + "x" )
1373
1394
1374
- # TODO: RUSTPYTHON
1375
- @unittest .expectedFailure
1376
1395
def test_and_or (self ):
1377
1396
self .check_stack_size ("x and x or " * self .N + "x" )
1378
1397
1379
- # TODO: RUSTPYTHON
1380
- @unittest .expectedFailure
1381
1398
def test_chained_comparison (self ):
1382
1399
self .check_stack_size ("x < " * self .N + "x" )
1383
1400
1384
- # TODO: RUSTPYTHON
1385
- @unittest .expectedFailure
1386
1401
def test_if_else (self ):
1387
1402
self .check_stack_size ("x if x else " * self .N + "x" )
1388
1403
1389
- # TODO: RUSTPYTHON
1390
- @unittest .expectedFailure
1391
1404
def test_binop (self ):
1392
1405
self .check_stack_size ("x + " * self .N + "x" )
1393
1406
1407
+ # TODO: RUSTPYTHON
1408
+ @unittest .expectedFailure
1394
1409
def test_list (self ):
1395
1410
self .check_stack_size ("[" + "x, " * self .N + "x]" )
1396
1411
1412
+ # TODO: RUSTPYTHON
1413
+ @unittest .expectedFailure
1397
1414
def test_tuple (self ):
1398
1415
self .check_stack_size ("(" + "x, " * self .N + "x)" )
1399
1416
1417
+ # TODO: RUSTPYTHON
1418
+ @unittest .expectedFailure
1400
1419
def test_set (self ):
1401
1420
self .check_stack_size ("{" + "x, " * self .N + "x}" )
1402
1421
1422
+ # TODO: RUSTPYTHON
1423
+ @unittest .expectedFailure
1403
1424
def test_dict (self ):
1404
1425
self .check_stack_size ("{" + "x:x, " * self .N + "x:x}" )
1405
1426
1427
+ # TODO: RUSTPYTHON
1428
+ @unittest .expectedFailure
1406
1429
def test_func_args (self ):
1407
1430
self .check_stack_size ("f(" + "x, " * self .N + ")" )
1408
1431
1432
+ # TODO: RUSTPYTHON
1433
+ @unittest .expectedFailure
1409
1434
def test_func_kwargs (self ):
1410
1435
kwargs = (f'a{ i } =x' for i in range (self .N ))
1411
1436
self .check_stack_size ("f(" + ", " .join (kwargs ) + ")" )
1412
1437
1438
+ # TODO: RUSTPYTHON
1439
+ @unittest .expectedFailure
1413
1440
def test_meth_args (self ):
1414
1441
self .check_stack_size ("o.m(" + "x, " * self .N + ")" )
1415
1442
1443
+ # TODO: RUSTPYTHON
1444
+ @unittest .expectedFailure
1416
1445
def test_meth_kwargs (self ):
1417
1446
kwargs = (f'a{ i } =x' for i in range (self .N ))
1418
1447
self .check_stack_size ("o.m(" + ", " .join (kwargs ) + ")" )
1419
1448
1420
- # TODO: RUSTPYTHON
1421
- @unittest .expectedFailure
1422
1449
def test_func_and (self ):
1423
1450
code = "def f(x):\n "
1424
1451
code += " x and x\n " * self .N
@@ -1513,6 +1540,8 @@ def test_try_except_as(self):
1513
1540
"""
1514
1541
self .check_stack_size (snippet )
1515
1542
1543
+ # TODO: RUSTPYTHON
1544
+ @unittest .expectedFailure
1516
1545
def test_try_except_star_qualified (self ):
1517
1546
snippet = """
1518
1547
try:
@@ -1524,6 +1553,8 @@ def test_try_except_star_qualified(self):
1524
1553
"""
1525
1554
self .check_stack_size (snippet )
1526
1555
1556
+ # TODO: RUSTPYTHON
1557
+ @unittest .expectedFailure
1527
1558
def test_try_except_star_as (self ):
1528
1559
snippet = """
1529
1560
try:
@@ -1535,6 +1566,8 @@ def test_try_except_star_as(self):
1535
1566
"""
1536
1567
self .check_stack_size (snippet )
1537
1568
1569
+ # TODO: RUSTPYTHON
1570
+ @unittest .expectedFailure
1538
1571
def test_try_except_star_finally (self ):
1539
1572
snippet = """
1540
1573
try:
0 commit comments