@@ -431,6 +431,7 @@ def create_function_page_props(self, test_functions: Dict["str", List[Item]]) ->
431431 )
432432
433433 is_benchmark = items [0 ].get_closest_marker ("benchmark" ) is not None
434+ is_stateful = items [0 ].get_closest_marker ("stateful" ) is not None
434435
435436 self .function_page_props [function_id ] = FunctionPageProps (
436437 title = get_test_function_name (items [0 ]),
@@ -447,6 +448,7 @@ def create_function_page_props(self, test_functions: Dict["str", List[Item]]) ->
447448 html_static_page_target = f"./{ get_test_function_name (items [0 ])} .html" ,
448449 mkdocs_function_page_target = f"./{ get_test_function_name (items [0 ])} /" ,
449450 is_benchmark = is_benchmark ,
451+ is_stateful = is_stateful ,
450452 )
451453
452454 def create_module_page_props (self ) -> None :
@@ -462,6 +464,7 @@ def create_module_page_props(self) -> None:
462464 pytest_node_id = str (module_path ),
463465 package_name = get_import_path (module_path ),
464466 is_benchmark = function_page .is_benchmark ,
467+ is_stateful = function_page .is_stateful ,
465468 test_functions = [
466469 TestFunction (
467470 name = function_page .title ,
@@ -475,6 +478,8 @@ def create_module_page_props(self) -> None:
475478 existing_module_page = self .module_page_props [str (function_page .path )]
476479 if function_page .is_benchmark :
477480 existing_module_page .is_benchmark = True
481+ if function_page .is_stateful :
482+ existing_module_page .is_stateful = True
478483 existing_module_page .test_functions .append (
479484 TestFunction (
480485 name = function_page .title ,
@@ -511,7 +516,12 @@ def add_directory_page_props(self) -> None:
511516 is_benchmark = any (
512517 module_page .is_benchmark
513518 for module_page in self .module_page_props .values ()
514- if module_page .path .parent == directory
519+ if directory in module_page .path .parents or module_page .path .parent == directory
520+ )
521+ is_stateful = any (
522+ module_page .is_stateful
523+ for module_page in self .module_page_props .values ()
524+ if directory in module_page .path .parents or module_page .path .parent == directory
515525 )
516526
517527 self .page_props [str (directory )] = DirectoryPageProps (
@@ -526,6 +536,7 @@ def add_directory_page_props(self) -> None:
526536 # init.py will be used for docstrings
527537 package_name = get_import_path (directory ),
528538 is_benchmark = is_benchmark ,
539+ is_stateful = is_stateful ,
529540 )
530541
531542 def find_files_within_collection_scope (self , file_pattern : str ) -> List [Path ]:
0 commit comments