@@ -424,6 +424,7 @@ def create_function_page_props(self, test_functions: Dict["str", List[Item]]) ->
424
424
)
425
425
426
426
is_benchmark = items [0 ].get_closest_marker ("benchmark" ) is not None
427
+ is_state = items [0 ].get_closest_marker ("state" ) is not None
427
428
428
429
self .function_page_props [function_id ] = FunctionPageProps (
429
430
title = get_test_function_name (items [0 ]),
@@ -440,6 +441,7 @@ def create_function_page_props(self, test_functions: Dict["str", List[Item]]) ->
440
441
html_static_page_target = f"./{ get_test_function_name (items [0 ])} .html" ,
441
442
mkdocs_function_page_target = f"./{ get_test_function_name (items [0 ])} /" ,
442
443
is_benchmark = is_benchmark ,
444
+ is_state = is_state ,
443
445
)
444
446
445
447
def create_module_page_props (self ) -> None :
@@ -455,6 +457,7 @@ def create_module_page_props(self) -> None:
455
457
pytest_node_id = str (module_path ),
456
458
package_name = get_import_path (module_path ),
457
459
is_benchmark = function_page .is_benchmark ,
460
+ is_state = function_page .is_state ,
458
461
test_functions = [
459
462
TestFunction (
460
463
name = function_page .title ,
@@ -468,6 +471,8 @@ def create_module_page_props(self) -> None:
468
471
existing_module_page = self .module_page_props [str (function_page .path )]
469
472
if function_page .is_benchmark :
470
473
existing_module_page .is_benchmark = True
474
+ if function_page .is_state :
475
+ existing_module_page .is_state = True
471
476
existing_module_page .test_functions .append (
472
477
TestFunction (
473
478
name = function_page .title ,
@@ -503,7 +508,12 @@ def add_directory_page_props(self) -> None:
503
508
is_benchmark = any (
504
509
module_page .is_benchmark
505
510
for module_page in self .module_page_props .values ()
506
- if module_page .path .parent == directory
511
+ if directory in module_page .path .parents or module_page .path .parent == directory
512
+ )
513
+ is_state = any (
514
+ module_page .is_state
515
+ for module_page in self .module_page_props .values ()
516
+ if directory in module_page .path .parents or module_page .path .parent == directory
507
517
)
508
518
509
519
self .page_props [str (directory )] = DirectoryPageProps (
@@ -516,6 +526,7 @@ def add_directory_page_props(self) -> None:
516
526
target_or_valid_fork = fork .capitalize () if fork else "Unknown" ,
517
527
package_name = get_import_path (directory ), # init.py will be used for docstrings
518
528
is_benchmark = is_benchmark ,
529
+ is_state = is_state ,
519
530
)
520
531
521
532
def find_files_within_collection_scope (self , file_pattern : str ) -> List [Path ]:
0 commit comments