Skip to content

Commit

Permalink
more typing
Browse files Browse the repository at this point in the history
  • Loading branch information
tybug committed Feb 6, 2025
1 parent a76ef13 commit 8e76016
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 8 additions & 1 deletion hypothesis-python/src/hypothesis/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from collections import defaultdict
from collections.abc import Coroutine, Generator, Hashable, Iterable, Sequence
from functools import partial
from inspect import Parameter
from random import Random
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -633,7 +634,13 @@ class Stuff:
given_kwargs: dict = attr.ib(factory=dict)


def process_arguments_to_given(wrapped_test, arguments, kwargs, given_kwargs, params):
def process_arguments_to_given(
wrapped_test: Any,
arguments: Sequence[object],
kwargs: dict[str, object],
given_kwargs: dict[str, SearchStrategy],
params: dict[str, Parameter],
) -> tuple[Sequence[object], dict[str, object], Stuff]:
selfy = None
arguments, kwargs = convert_positional_arguments(wrapped_test, arguments, kwargs)

Expand Down
6 changes: 4 additions & 2 deletions hypothesis-python/src/hypothesis/internal/reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import textwrap
import types
import warnings
from collections.abc import MutableMapping
from collections.abc import MutableMapping, Sequence
from functools import partial, wraps
from io import StringIO
from keyword import iskeyword
Expand Down Expand Up @@ -214,7 +214,9 @@ def convert_keyword_arguments(function, args, kwargs):
return bound.args, bound.kwargs


def convert_positional_arguments(function, args, kwargs):
def convert_positional_arguments(
function: Any, args: Sequence[object], kwargs: dict[str, object]
) -> tuple[tuple[object, ...], dict[str, object]]:
"""Return a tuple (new_args, new_kwargs) where all possible arguments have
been moved to kwargs.
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/tests/conjecture/test_optimiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import pytest

from hypothesis import assume, example, given, settings
from hypothesis.internal.conjecture.data import Status
from hypothesis.internal.conjecture.choice import ChoiceNode
from hypothesis.internal.conjecture.data import Status
from hypothesis.internal.conjecture.datatree import compute_max_children
from hypothesis.internal.conjecture.engine import ConjectureRunner, RunIsComplete
from hypothesis.internal.entropy import deterministic_PRNG
Expand Down

0 comments on commit 8e76016

Please sign in to comment.