Skip to content

Commit a7a4e95

Browse files
authored
fix(tests): assign ids to parametrized EOF code sections (#1427)
Otherwise, the generated test names are too long and filling fails.
1 parent 73fdb4a commit a7a4e95

File tree

1 file changed

+128
-80
lines changed

1 file changed

+128
-80
lines changed

tests/osaka/eip7692_eof_v1/eip4750_functions/test_code_validation.py

Lines changed: 128 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -855,41 +855,59 @@ def test_callf_validate_outputs(eof_test: EOFTestFiller, stack_height: int):
855855
@pytest.mark.parametrize(
856856
"code_section",
857857
[
858-
Section.Code(
859-
code=Op.POP * 2 + Op.RETF,
860-
code_inputs=2,
861-
code_outputs=0,
862-
max_stack_height=2,
858+
pytest.param(
859+
Section.Code(
860+
code=Op.POP * 2 + Op.RETF,
861+
code_inputs=2,
862+
code_outputs=0,
863+
max_stack_height=2,
864+
),
865+
id="pop2",
863866
),
864-
Section.Code(
865-
code=Op.PUSH1[1] + Op.POP + Op.RETF,
866-
code_inputs=3,
867-
code_outputs=3,
868-
max_stack_height=4,
867+
pytest.param(
868+
Section.Code(
869+
code=Op.PUSH1[1] + Op.POP + Op.RETF,
870+
code_inputs=3,
871+
code_outputs=3,
872+
max_stack_height=4,
873+
),
874+
id="push_pop",
869875
),
870-
Section.Code(
871-
code=Op.PUSH0 * 2 + Op.RETF,
872-
code_inputs=3,
873-
code_outputs=5,
874-
max_stack_height=5,
876+
pytest.param(
877+
Section.Code(
878+
code=Op.PUSH0 * 2 + Op.RETF,
879+
code_inputs=3,
880+
code_outputs=5,
881+
max_stack_height=5,
882+
),
883+
id="push2",
875884
),
876-
Section.Code(
877-
code=Op.PUSH0 * 2 + Op.POP * 2 + Op.RETF,
878-
code_inputs=3,
879-
code_outputs=3,
880-
max_stack_height=5,
885+
pytest.param(
886+
Section.Code(
887+
code=Op.PUSH0 * 2 + Op.POP * 2 + Op.RETF,
888+
code_inputs=3,
889+
code_outputs=3,
890+
max_stack_height=5,
891+
),
892+
id="push2_pop2",
881893
),
882-
Section.Code(
883-
code=Op.PUSH0 + Op.POP * 3 + Op.RETF,
884-
code_inputs=2,
885-
code_outputs=0,
886-
max_stack_height=3,
894+
pytest.param(
895+
Section.Code(
896+
code=Op.PUSH0 + Op.POP * 3 + Op.RETF,
897+
code_inputs=2,
898+
code_outputs=0,
899+
max_stack_height=3,
900+
),
901+
id="push_pop3",
887902
),
888-
Section.Code(
889-
code=Op.PUSH0 * 2 + Op.POP * 4 + Op.RETF,
890-
code_inputs=2,
891-
code_outputs=0,
892-
max_stack_height=4,
903+
pytest.param(
904+
Section.Code(
905+
code=Op.PUSH0 * 2 + Op.POP * 4 + Op.RETF,
906+
code_inputs=2,
907+
code_outputs=0,
908+
max_stack_height=4,
909+
),
910+
id="push2_pop4",
893911
),
894912
],
895913
)
@@ -924,65 +942,95 @@ def test_callf_with_inputs_stack_overflow(
924942
@pytest.mark.parametrize(
925943
"code_section",
926944
[
927-
Section.Code(
928-
code=Op.POP * 2 + Op.RETF,
929-
code_inputs=2,
930-
code_outputs=0,
931-
max_stack_height=2,
945+
pytest.param(
946+
Section.Code(
947+
code=Op.POP * 2 + Op.RETF,
948+
code_inputs=2,
949+
code_outputs=0,
950+
max_stack_height=2,
951+
),
952+
id="pop2",
932953
),
933-
Section.Code(
934-
code=Op.PUSH1[1] + Op.POP + Op.RETF,
935-
code_inputs=3,
936-
code_outputs=3,
937-
max_stack_height=4,
954+
pytest.param(
955+
Section.Code(
956+
code=Op.PUSH1[1] + Op.POP + Op.RETF,
957+
code_inputs=3,
958+
code_outputs=3,
959+
max_stack_height=4,
960+
),
961+
id="push_pop",
938962
),
939-
Section.Code(
940-
code=Op.PUSH0 * 4 + Op.RETF,
941-
code_inputs=3,
942-
code_outputs=7,
943-
max_stack_height=7,
963+
pytest.param(
964+
Section.Code(
965+
code=Op.PUSH0 * 4 + Op.RETF,
966+
code_inputs=3,
967+
code_outputs=7,
968+
max_stack_height=7,
969+
),
970+
id="push4",
944971
),
945-
Section.Code(
946-
code=Op.PUSH0 * 2 + Op.RETF,
947-
code_inputs=3,
948-
code_outputs=5,
949-
max_stack_height=5,
972+
pytest.param(
973+
Section.Code(
974+
code=Op.PUSH0 * 2 + Op.RETF,
975+
code_inputs=3,
976+
code_outputs=5,
977+
max_stack_height=5,
978+
),
979+
id="push2",
950980
),
951-
Section.Code(
952-
code=Op.PUSH0 * 4 + Op.POP * 2 + Op.RETF,
953-
code_inputs=3,
954-
code_outputs=3,
955-
max_stack_height=7,
981+
pytest.param(
982+
Section.Code(
983+
code=Op.PUSH0 * 4 + Op.POP * 2 + Op.RETF,
984+
code_inputs=3,
985+
code_outputs=3,
986+
max_stack_height=7,
987+
),
988+
id="push4_pop2",
956989
),
957-
Section.Code(
958-
code=Op.PUSH0 * 2 + Op.POP * 2 + Op.RETF,
959-
code_inputs=3,
960-
code_outputs=3,
961-
max_stack_height=5,
990+
pytest.param(
991+
Section.Code(
992+
code=Op.PUSH0 * 2 + Op.POP * 2 + Op.RETF,
993+
code_inputs=3,
994+
code_outputs=3,
995+
max_stack_height=5,
996+
),
997+
id="push2_pop2",
962998
),
963-
Section.Code(
964-
code=Op.PUSH0 * 3 + Op.POP * 5 + Op.RETF,
965-
code_inputs=2,
966-
code_outputs=0,
967-
max_stack_height=5,
999+
pytest.param(
1000+
Section.Code(
1001+
code=Op.PUSH0 * 3 + Op.POP * 5 + Op.RETF,
1002+
code_inputs=2,
1003+
code_outputs=0,
1004+
max_stack_height=5,
1005+
),
1006+
id="push3_pop5",
9681007
),
969-
Section.Code(
970-
code=Op.PUSH0 + Op.POP * 3 + Op.RETF,
971-
code_inputs=2,
972-
code_outputs=0,
973-
max_stack_height=3,
1008+
pytest.param(
1009+
Section.Code(
1010+
code=Op.PUSH0 + Op.POP * 3 + Op.RETF,
1011+
code_inputs=2,
1012+
code_outputs=0,
1013+
max_stack_height=3,
1014+
),
1015+
id="push_pop3",
9741016
),
975-
Section.Code(
976-
code=Op.PUSH0 * 4 + Op.POP * 6 + Op.RETF,
977-
code_inputs=2,
978-
code_outputs=0,
979-
max_stack_height=6,
1017+
pytest.param(
1018+
Section.Code(
1019+
code=Op.PUSH0 * 4 + Op.POP * 6 + Op.RETF,
1020+
code_inputs=2,
1021+
code_outputs=0,
1022+
max_stack_height=6,
1023+
),
1024+
id="push4_pop6",
9801025
),
981-
Section.Code(
982-
code=Op.PUSH0 * 2 + Op.POP * 4 + Op.RETF,
983-
code_inputs=2,
984-
code_outputs=0,
985-
max_stack_height=4,
1026+
pytest.param(
1027+
Section.Code(
1028+
code=Op.PUSH0 * 2 + Op.POP * 4 + Op.RETF,
1029+
code_inputs=2,
1030+
code_outputs=0,
1031+
max_stack_height=4,
1032+
),
1033+
id="push2_pop4",
9861034
),
9871035
],
9881036
)

0 commit comments

Comments
 (0)