Skip to content

Commit

Permalink
Docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrepta committed Jul 3, 2024
1 parent 71bc069 commit 47a187b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions pyk/src/pyk/ktool/kfuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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]],
Expand All @@ -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)
Expand Down

0 comments on commit 47a187b

Please sign in to comment.