@@ -476,6 +476,10 @@ def pytest_sessionfinish(self) -> None:
476476
477477
478478def pytest_addoption (parser : Parser ) -> None :
479+ """Add command-line options for cache functionality.
480+
481+ :param parser: Parser object to add command-line options to.
482+ """
479483 group = parser .getgroup ("general" )
480484 group .addoption (
481485 "--lf" ,
@@ -546,6 +550,13 @@ def pytest_cmdline_main(config: Config) -> int | ExitCode | None:
546550
547551@hookimpl (tryfirst = True )
548552def pytest_configure (config : Config ) -> None :
553+ """Configure cache system and register related plugins.
554+
555+ Creates the Cache instance and registers the last-failed (LFPlugin)
556+ and new-first (NFPlugin) plugins with the plugin manager.
557+
558+ :param config: pytest configuration object.
559+ """
549560 config .cache = Cache .for_config (config , _ispytest = True )
550561 config .pluginmanager .register (LFPlugin (config ), "lfplugin" )
551562 config .pluginmanager .register (NFPlugin (config ), "nfplugin" )
@@ -584,6 +595,16 @@ def pytest_report_header(config: Config) -> str | None:
584595
585596
586597def cacheshow (config : Config , session : Session ) -> int :
598+ """Display cache contents when --cache-show is used.
599+
600+ Shows cached values and directories matching the specified glob pattern
601+ (default: '*'). Displays cache location, cached test results, and
602+ any cached directories created by plugins.
603+
604+ :param config: pytest configuration object.
605+ :param session: pytest session object.
606+ :returns: Exit code (0 for success).
607+ """
587608 from pprint import pformat
588609
589610 assert config .cache is not None
0 commit comments