From 47a187bfb104aff9eb504bb111538e8d6a8b4b37 Mon Sep 17 00:00:00 2001 From: Guy Repta <50716988+gtrepta@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:44:56 -0500 Subject: [PATCH] Docstrings --- pyk/src/pyk/ktool/kfuzz.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pyk/src/pyk/ktool/kfuzz.py b/pyk/src/pyk/ktool/kfuzz.py index 51e8b907191..15c8e79a0e4 100644 --- a/pyk/src/pyk/ktool/kfuzz.py +++ b/pyk/src/pyk/ktool/kfuzz.py @@ -33,15 +33,25 @@ def fuzz_with_check( template: Pattern, subst_strategy: dict[EVar, SearchStrategy[Pattern]], check_func: Callable[[Pattern], Any], + **hypothesis_args: Any, ) -> None: - _fuzz(self.definition_dir, template, subst_strategy, check_func=check_func) + """Fuzz over a property test using check_func to check for a passing test. + + See :any:`fuzz` for info on the parameters. + """ + fuzz(self.definition_dir, template, subst_strategy, check_func=check_func) def fuzz_with_exit_code( self, template: Pattern, subst_strategy: dict[EVar, SearchStrategy[Pattern]], + **hypothesis_args: Any, ) -> None: - _fuzz(self.definition_dir, template, subst_strategy, check_exit_code=True) + """Fuzz over a property test using the exit code from the interpreter to check for a passing test. + + See :any:`fuzz` for info on the parameters. + """ + fuzz(self.definition_dir, template, subst_strategy, check_exit_code=True) def kintegers( @@ -70,7 +80,7 @@ def int_dv(value: int) -> Pattern: return integers(min_value=min_value, max_value=max_value).map(int_dv) -def _fuzz( +def fuzz( definition_dir: str | Path, template: Pattern, subst_strategy: dict[EVar, SearchStrategy[Pattern]], @@ -91,7 +101,9 @@ def _fuzz( An exit code of 0 indicates a passing test. A RuntimeError will be thrown if this is True and check_func is also passed as an argument. hypothesis_args: Keyword arguments that will be passed as settings for the hypothesis test. Defaults: + deadline: 5000 + phases: (Phase.explicit, Phase.reuse, Phase.generate)