@@ -242,16 +242,16 @@ def pytest_addoption(parser: pytest.Parser):
242242 ),
243243 )
244244 test_group .addoption (
245- "--generate-grouped- pre-allocs " ,
245+ "--generate-pre-alloc-groups " ,
246246 action = "store_true" ,
247- dest = "generate_grouped_pre_allocs " ,
247+ dest = "generate_pre_alloc_groups " ,
248248 default = False ,
249249 help = "Generate pre-allocation groups (phase 1 only)." ,
250250 )
251251 test_group .addoption (
252- "--use-grouped- pre-allocs " ,
252+ "--use-pre-alloc-groups " ,
253253 action = "store_true" ,
254- dest = "use_grouped_pre_allocs " ,
254+ dest = "use_pre_alloc_groups " ,
255255 default = False ,
256256 help = "Fill tests using existing pre-allocation groups (phase 2 only)." ,
257257 )
@@ -286,20 +286,20 @@ def pytest_sessionstart(session: pytest.Session):
286286 load the pre-allocation groups for phase 2 execution.
287287 """
288288 # Initialize empty pre-allocation groups container for phase 1
289- if session .config .getoption ("generate_grouped_pre_allocs " ):
290- session .config .grouped_pre_allocs = PreAllocGroups (root = {}) # type: ignore[attr-defined]
289+ if session .config .getoption ("generate_pre_alloc_groups " ):
290+ session .config .pre_alloc_groups = PreAllocGroups (root = {}) # type: ignore[attr-defined]
291291
292292 # Load the pre-allocation groups for phase 2
293- if session .config .getoption ("use_grouped_pre_allocs " ):
294- grouped_pre_allocs_folder = session .config .fixture_output .grouped_pre_allocs_folder_path # type: ignore[attr-defined]
295- if grouped_pre_allocs_folder .exists ():
296- session .config .grouped_pre_allocs = PreAllocGroups .from_folder ( # type: ignore[attr-defined]
297- grouped_pre_allocs_folder
293+ if session .config .getoption ("use_pre_alloc_groups " ):
294+ pre_alloc_groups_folder = session .config .fixture_output .pre_alloc_groups_folder_path # type: ignore[attr-defined]
295+ if pre_alloc_groups_folder .exists ():
296+ session .config .pre_alloc_groups = PreAllocGroups .from_folder ( # type: ignore[attr-defined]
297+ pre_alloc_groups_folder
298298 )
299299 else :
300300 pytest .exit (
301- f"Pre-allocation groups folder not found: { grouped_pre_allocs_folder } . "
302- "Run phase 1 with --generate-grouped- pre-allocs first." ,
301+ f"Pre-allocation groups folder not found: { pre_alloc_groups_folder } . "
302+ "Run phase 1 with --generate-pre-alloc-groups first." ,
303303 returncode = pytest .ExitCode .USAGE_ERROR ,
304304 )
305305
@@ -339,7 +339,7 @@ def pytest_configure(config):
339339 if (
340340 not config .getoption ("disable_html" )
341341 and config .getoption ("htmlpath" ) is None
342- and not config .getoption ("generate_grouped_pre_allocs " )
342+ and not config .getoption ("generate_pre_alloc_groups " )
343343 ):
344344 config .option .htmlpath = config .fixture_output .directory / default_html_report_file_path ()
345345
@@ -416,21 +416,21 @@ def pytest_terminal_summary(
416416 stats = terminalreporter .stats
417417 if "passed" in stats and stats ["passed" ]:
418418 # Custom message for Phase 1 (pre-allocation group generation)
419- if config .getoption ("generate_grouped_pre_allocs " ):
419+ if config .getoption ("generate_pre_alloc_groups " ):
420420 # Generate summary stats
421- grouped_pre_allocs : PreAllocGroups
421+ pre_alloc_groups : PreAllocGroups
422422 if config .pluginmanager .hasplugin ("xdist" ):
423423 # Load pre-allocation groups from disk
424- grouped_pre_allocs = PreAllocGroups .from_folder (
425- config .fixture_output .grouped_pre_allocs_folder_path # type: ignore[attr-defined]
424+ pre_alloc_groups = PreAllocGroups .from_folder (
425+ config .fixture_output .pre_alloc_groups_folder_path # type: ignore[attr-defined]
426426 )
427427 else :
428- assert hasattr (config , "grouped_pre_allocs " )
429- grouped_pre_allocs = config .grouped_pre_allocs # type: ignore[attr-defined]
428+ assert hasattr (config , "pre_alloc_groups " )
429+ pre_alloc_groups = config .pre_alloc_groups # type: ignore[attr-defined]
430430
431- total_groups = len (grouped_pre_allocs .root )
431+ total_groups = len (pre_alloc_groups .root )
432432 total_accounts = sum (
433- group .pre_account_count for group in grouped_pre_allocs .root .values ()
433+ group .pre_account_count for group in pre_alloc_groups .root .values ()
434434 )
435435
436436 terminalreporter .write_sep (
@@ -881,32 +881,32 @@ def __init__(self, *args, **kwargs):
881881
882882 # Phase 1: Generate pre-allocation groups
883883 if fixture_format is BlockchainEngineXFixture and request .config .getoption (
884- "generate_grouped_pre_allocs "
884+ "generate_pre_alloc_groups "
885885 ):
886886 self .update_pre_alloc_groups (
887- request .config .grouped_pre_allocs , fork , request .node .nodeid
887+ request .config .pre_alloc_groups , fork , request .node .nodeid
888888 )
889889 return # Skip fixture generation in phase 1
890890
891891 # Phase 2: Use pre-allocation groups (only for BlockchainEngineXFixture)
892892 pre_alloc_hash = None
893893 if fixture_format is BlockchainEngineXFixture and request .config .getoption (
894- "use_grouped_pre_allocs "
894+ "use_pre_alloc_groups "
895895 ):
896896 pre_alloc_hash = self .compute_pre_alloc_group_hash (fork = fork )
897- if pre_alloc_hash not in request .config .grouped_pre_allocs :
897+ if pre_alloc_hash not in request .config .pre_alloc_groups :
898898 pre_alloc_path = (
899- request .config .fixture_output .grouped_pre_allocs_folder_path
899+ request .config .fixture_output .pre_alloc_groups_folder_path
900900 / pre_alloc_hash
901901 )
902902 raise ValueError (
903903 f"Pre-allocation hash { pre_alloc_hash } not found in "
904904 f"pre-allocation groups. "
905905 f"Please check the pre-allocation groups file at: { pre_alloc_path } . "
906- "Make sure phase 1 (--generate-grouped- pre-allocs ) was run "
906+ "Make sure phase 1 (--generate-pre-alloc-groups ) was run "
907907 "before phase 2."
908908 )
909- group : PreAllocGroup = request .config .grouped_pre_allocs [pre_alloc_hash ]
909+ group : PreAllocGroup = request .config .pre_alloc_groups [pre_alloc_hash ]
910910 self .pre = group .pre
911911
912912 fixture = self .generate (
@@ -918,14 +918,14 @@ def __init__(self, *args, **kwargs):
918918 # Post-process for Engine X format (add pre_hash and state diff)
919919 if (
920920 fixture_format is BlockchainEngineXFixture
921- and request .config .getoption ("use_grouped_pre_allocs " )
921+ and request .config .getoption ("use_pre_alloc_groups " )
922922 and pre_alloc_hash is not None
923923 ):
924924 fixture .pre_hash = pre_alloc_hash
925925
926926 # Calculate state diff for efficiency
927927 if hasattr (fixture , "post_state" ) and fixture .post_state is not None :
928- group = request .config .grouped_pre_allocs [pre_alloc_hash ]
928+ group = request .config .pre_alloc_groups [pre_alloc_hash ]
929929 fixture .post_state_diff = calculate_post_state_diff (
930930 fixture .post_state , group .pre
931931 )
@@ -968,12 +968,12 @@ def pytest_generate_tests(metafunc: pytest.Metafunc):
968968 """
969969 for test_type in BaseTest .spec_types .values ():
970970 if test_type .pytest_parameter_name () in metafunc .fixturenames :
971- generate_grouped_pre_allocs = metafunc .config .getoption (
972- "generate_grouped_pre_allocs " , False
971+ generate_pre_alloc_groups = metafunc .config .getoption (
972+ "generate_pre_alloc_groups " , False
973973 )
974- use_grouped_pre_allocs = metafunc .config .getoption ("use_grouped_pre_allocs " , False )
974+ use_pre_alloc_groups = metafunc .config .getoption ("use_pre_alloc_groups " , False )
975975
976- if generate_grouped_pre_allocs or use_grouped_pre_allocs :
976+ if generate_pre_alloc_groups or use_pre_alloc_groups :
977977 # When pre-allocation group flags are set, only generate BlockchainEngineXFixture
978978 supported_formats = [
979979 format_item
@@ -1080,12 +1080,12 @@ def pytest_sessionfinish(session: pytest.Session, exitstatus: int):
10801080 """
10811081 # Save pre-allocation groups after phase 1
10821082 fixture_output = session .config .fixture_output # type: ignore[attr-defined]
1083- if session .config .getoption ("generate_grouped_pre_allocs " ) and hasattr (
1084- session .config , "grouped_pre_allocs "
1083+ if session .config .getoption ("generate_pre_alloc_groups " ) and hasattr (
1084+ session .config , "pre_alloc_groups "
10851085 ):
1086- grouped_pre_allocs_folder = fixture_output .grouped_pre_allocs_folder_path
1087- grouped_pre_allocs_folder .mkdir (parents = True , exist_ok = True )
1088- session .config .grouped_pre_allocs .to_folder (grouped_pre_allocs_folder )
1086+ pre_alloc_groups_folder = fixture_output .pre_alloc_groups_folder_path
1087+ pre_alloc_groups_folder .mkdir (parents = True , exist_ok = True )
1088+ session .config .pre_alloc_groups .to_folder (pre_alloc_groups_folder )
10891089 return
10901090
10911091 if xdist .is_xdist_worker (session ):
@@ -1100,7 +1100,7 @@ def pytest_sessionfinish(session: pytest.Session, exitstatus: int):
11001100
11011101 # Generate index file for all produced fixtures.
11021102 if session .config .getoption ("generate_index" ) and not session .config .getoption (
1103- "generate_grouped_pre_allocs "
1103+ "generate_pre_alloc_groups "
11041104 ):
11051105 generate_fixtures_index (
11061106 fixture_output .directory , quiet_mode = True , force_flag = False , disable_infer_format = False
0 commit comments