@@ -431,6 +431,7 @@ def create_function_page_props(self, test_functions: Dict["str", List[Item]]) ->
431
431
)
432
432
433
433
is_benchmark = items [0 ].get_closest_marker ("benchmark" ) is not None
434
+ is_stateful = items [0 ].get_closest_marker ("stateful" ) is not None
434
435
435
436
self .function_page_props [function_id ] = FunctionPageProps (
436
437
title = get_test_function_name (items [0 ]),
@@ -447,6 +448,7 @@ def create_function_page_props(self, test_functions: Dict["str", List[Item]]) ->
447
448
html_static_page_target = f"./{ get_test_function_name (items [0 ])} .html" ,
448
449
mkdocs_function_page_target = f"./{ get_test_function_name (items [0 ])} /" ,
449
450
is_benchmark = is_benchmark ,
451
+ is_stateful = is_stateful ,
450
452
)
451
453
452
454
def create_module_page_props (self ) -> None :
@@ -462,6 +464,7 @@ def create_module_page_props(self) -> None:
462
464
pytest_node_id = str (module_path ),
463
465
package_name = get_import_path (module_path ),
464
466
is_benchmark = function_page .is_benchmark ,
467
+ is_stateful = function_page .is_stateful ,
465
468
test_functions = [
466
469
TestFunction (
467
470
name = function_page .title ,
@@ -475,6 +478,8 @@ def create_module_page_props(self) -> None:
475
478
existing_module_page = self .module_page_props [str (function_page .path )]
476
479
if function_page .is_benchmark :
477
480
existing_module_page .is_benchmark = True
481
+ if function_page .is_stateful :
482
+ existing_module_page .is_stateful = True
478
483
existing_module_page .test_functions .append (
479
484
TestFunction (
480
485
name = function_page .title ,
@@ -511,7 +516,12 @@ def add_directory_page_props(self) -> None:
511
516
is_benchmark = any (
512
517
module_page .is_benchmark
513
518
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
515
525
)
516
526
517
527
self .page_props [str (directory )] = DirectoryPageProps (
@@ -526,6 +536,7 @@ def add_directory_page_props(self) -> None:
526
536
# init.py will be used for docstrings
527
537
package_name = get_import_path (directory ),
528
538
is_benchmark = is_benchmark ,
539
+ is_stateful = is_stateful ,
529
540
)
530
541
531
542
def find_files_within_collection_scope (self , file_pattern : str ) -> List [Path ]:
0 commit comments