schemathesis 3.33.2__py3-none-any.whl → 3.33.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- schemathesis/specs/openapi/examples.py +18 -1
- schemathesis/stateful/config.py +7 -2
- schemathesis/stateful/runner.py +1 -1
- {schemathesis-3.33.2.dist-info → schemathesis-3.33.3.dist-info}/METADATA +1 -1
- {schemathesis-3.33.2.dist-info → schemathesis-3.33.3.dist-info}/RECORD +8 -8
- {schemathesis-3.33.2.dist-info → schemathesis-3.33.3.dist-info}/WHEEL +0 -0
- {schemathesis-3.33.2.dist-info → schemathesis-3.33.3.dist-info}/entry_points.txt +0 -0
- {schemathesis-3.33.2.dist-info → schemathesis-3.33.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -12,6 +12,7 @@ from hypothesis_jsonschema import from_schema
|
|
|
12
12
|
|
|
13
13
|
from ..._hypothesis import get_single_example
|
|
14
14
|
from ...constants import DEFAULT_RESPONSE_TIMEOUT
|
|
15
|
+
from ...internal.copy import fast_deepcopy
|
|
15
16
|
from ...models import APIOperation, Case
|
|
16
17
|
from ._hypothesis import get_case_strategy, get_default_format_strategies
|
|
17
18
|
from .constants import LOCATION_TO_CONTAINER
|
|
@@ -130,10 +131,26 @@ def extract_top_level(operation: APIOperation[OpenAPIParameter, Case]) -> Genera
|
|
|
130
131
|
def _expand_subschemas(schema: dict[str, Any] | bool) -> Generator[dict[str, Any] | bool, None, None]:
|
|
131
132
|
yield schema
|
|
132
133
|
if isinstance(schema, dict):
|
|
133
|
-
for key in ("anyOf", "oneOf"
|
|
134
|
+
for key in ("anyOf", "oneOf"):
|
|
134
135
|
if key in schema:
|
|
135
136
|
for subschema in schema[key]:
|
|
136
137
|
yield subschema
|
|
138
|
+
if "allOf" in schema:
|
|
139
|
+
subschema = fast_deepcopy(schema["allOf"][0])
|
|
140
|
+
for sub in schema["allOf"][1:]:
|
|
141
|
+
if isinstance(sub, dict):
|
|
142
|
+
for key, value in sub.items():
|
|
143
|
+
if key == "properties":
|
|
144
|
+
subschema.setdefault("properties", {}).update(value)
|
|
145
|
+
elif key == "required":
|
|
146
|
+
subschema.setdefault("required", []).extend(value)
|
|
147
|
+
elif key == "examples":
|
|
148
|
+
subschema.setdefault("examples", []).extend(value)
|
|
149
|
+
elif key == "example":
|
|
150
|
+
subschema.setdefault("examples", []).append(value)
|
|
151
|
+
else:
|
|
152
|
+
subschema[key] = value
|
|
153
|
+
yield subschema
|
|
137
154
|
|
|
138
155
|
|
|
139
156
|
def _find_parameter_examples_definition(
|
schemathesis/stateful/config.py
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
|
+
from datetime import timedelta
|
|
4
5
|
from typing import TYPE_CHECKING, Any
|
|
5
6
|
|
|
7
|
+
from ..constants import DEFAULT_DEADLINE
|
|
8
|
+
|
|
6
9
|
if TYPE_CHECKING:
|
|
7
10
|
import hypothesis
|
|
8
11
|
from requests.auth import HTTPDigestAuth
|
|
@@ -24,7 +27,7 @@ def _default_checks_factory() -> tuple[CheckFunction, ...]:
|
|
|
24
27
|
def _get_default_hypothesis_settings_kwargs() -> dict[str, Any]:
|
|
25
28
|
import hypothesis
|
|
26
29
|
|
|
27
|
-
return {"phases": (hypothesis.Phase.generate,), "deadline": None}
|
|
30
|
+
return {"phases": (hypothesis.Phase.generate,), "deadline": None, "stateful_step_count": 10}
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
def _default_hypothesis_settings_factory() -> hypothesis.settings:
|
|
@@ -79,6 +82,8 @@ def _get_hypothesis_settings_kwargs_override(settings: hypothesis.settings) -> d
|
|
|
79
82
|
state_machine_default = _default_hypothesis_settings_factory()
|
|
80
83
|
if settings.phases == hypothesis_default.phases:
|
|
81
84
|
kwargs["phases"] = state_machine_default.phases
|
|
82
|
-
if settings.
|
|
85
|
+
if settings.stateful_step_count == hypothesis_default.stateful_step_count:
|
|
86
|
+
kwargs["stateful_step_count"] = state_machine_default.stateful_step_count
|
|
87
|
+
if settings.deadline in (hypothesis_default.deadline, timedelta(milliseconds=DEFAULT_DEADLINE)):
|
|
83
88
|
kwargs["deadline"] = state_machine_default.deadline
|
|
84
89
|
return kwargs
|
schemathesis/stateful/runner.py
CHANGED
|
@@ -7,10 +7,10 @@ from dataclasses import dataclass, field
|
|
|
7
7
|
from typing import TYPE_CHECKING, Any, Generator, Iterator, Type
|
|
8
8
|
|
|
9
9
|
import hypothesis
|
|
10
|
-
from hypothesis.stateful import Rule
|
|
11
10
|
import requests
|
|
12
11
|
from hypothesis.control import current_build_context
|
|
13
12
|
from hypothesis.errors import Flaky
|
|
13
|
+
from hypothesis.stateful import Rule
|
|
14
14
|
|
|
15
15
|
from ..exceptions import CheckFailed
|
|
16
16
|
from ..targets import TargetMetricCollector
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: schemathesis
|
|
3
|
-
Version: 3.33.
|
|
3
|
+
Version: 3.33.3
|
|
4
4
|
Summary: Property-based testing framework for Open API and GraphQL based apps
|
|
5
5
|
Project-URL: Documentation, https://schemathesis.readthedocs.io/en/stable/
|
|
6
6
|
Project-URL: Changelog, https://schemathesis.readthedocs.io/en/stable/changelog.html
|
|
@@ -104,7 +104,7 @@ schemathesis/specs/openapi/checks.py,sha256=eFjbV9-0202qg0s0JjaBNRr7nf8Bd8VMLPHE
|
|
|
104
104
|
schemathesis/specs/openapi/constants.py,sha256=JqM_FHOenqS_MuUE9sxVQ8Hnw0DNM8cnKDwCwPLhID4,783
|
|
105
105
|
schemathesis/specs/openapi/converter.py,sha256=TaYgc5BBHPdkN-n0lqpbeVgLu3eL3L8Wu3y_Vo3TJaQ,2800
|
|
106
106
|
schemathesis/specs/openapi/definitions.py,sha256=Z186F0gNBSCmPg-Kk7Q-n6XxEZHIOzgUyeqixlC62XE,94058
|
|
107
|
-
schemathesis/specs/openapi/examples.py,sha256=
|
|
107
|
+
schemathesis/specs/openapi/examples.py,sha256=ElfX1kZ4XWfOSOVbes_ovy4P6q_NgWpa0RF0rNJLVM4,16170
|
|
108
108
|
schemathesis/specs/openapi/formats.py,sha256=JmmkQWNAj5XreXb7Edgj4LADAf4m86YulR_Ec8evpJ4,1220
|
|
109
109
|
schemathesis/specs/openapi/links.py,sha256=2ucOLs50OhCqu0PEdbT_BGUM3fKnHBl97YGISLpAxLY,16023
|
|
110
110
|
schemathesis/specs/openapi/loaders.py,sha256=AcpvTK8qdirSRcHcinCjQbwfSQSx448LAh_GvFML1C0,25515
|
|
@@ -131,10 +131,10 @@ schemathesis/specs/openapi/stateful/__init__.py,sha256=bQLAavl0-B3hGjEgfrS8o7cPS
|
|
|
131
131
|
schemathesis/specs/openapi/stateful/statistic.py,sha256=EJK4NqeAYRYl1FtU9YEuTLyhGhPmks0bLoxUPuQlOvM,7443
|
|
132
132
|
schemathesis/specs/openapi/stateful/types.py,sha256=UuGcCTFvaHsqeLN9ZeUNcbjsEwmthoT3UcHfDHchOYo,419
|
|
133
133
|
schemathesis/stateful/__init__.py,sha256=qyQJ-9Ect-AWZiAsK63F3BTGu-jZnPCOp1q46YAonkQ,4911
|
|
134
|
-
schemathesis/stateful/config.py,sha256=
|
|
134
|
+
schemathesis/stateful/config.py,sha256=t2_xW_4-MnrjQFiZC9heHdwP_ftHgFS-zptgq5Ba380,3235
|
|
135
135
|
schemathesis/stateful/context.py,sha256=MeP3-lKyhtAd-jzApC65AWlDZSOBzQq0IgK-nvagYqs,4519
|
|
136
136
|
schemathesis/stateful/events.py,sha256=reGjsmS-y2izRd3bahpEZNe4zxTSpKAkPI-nCQyoUzI,6733
|
|
137
|
-
schemathesis/stateful/runner.py,sha256=
|
|
137
|
+
schemathesis/stateful/runner.py,sha256=tIlXRpy0Y0vuQYjTlafpZ4Ur_KhFhdK5CH7ScRvDPWk,11110
|
|
138
138
|
schemathesis/stateful/sink.py,sha256=xjsqJYH5WETKh5pDGlchYyjT3HcjzHEotUjvo1p0JsE,2470
|
|
139
139
|
schemathesis/stateful/state_machine.py,sha256=iRbznWxHnUdLhMpiBaHxe6Nh1EacyGnGFz4DCRwV5j4,12228
|
|
140
140
|
schemathesis/stateful/statistic.py,sha256=xPLiCw61ofNXQicqcK_sZyLHiqiGcgQARpwd8AiRubM,487
|
|
@@ -144,8 +144,8 @@ schemathesis/transports/auth.py,sha256=yELjkEkfx4g74hNrd0Db9aFf0xDJDRIwhg2vzKOTZ
|
|
|
144
144
|
schemathesis/transports/content_types.py,sha256=VrcRQvF5T_TUjrCyrZcYF2LOwKfs3IrLcMtkVSp1ImI,2189
|
|
145
145
|
schemathesis/transports/headers.py,sha256=hr_AIDOfUxsJxpHfemIZ_uNG3_vzS_ZeMEKmZjbYiBE,990
|
|
146
146
|
schemathesis/transports/responses.py,sha256=6-gvVcRK0Ho_lSydUysBNFWoJwZEiEgf6Iv-GWkQGd8,1675
|
|
147
|
-
schemathesis-3.33.
|
|
148
|
-
schemathesis-3.33.
|
|
149
|
-
schemathesis-3.33.
|
|
150
|
-
schemathesis-3.33.
|
|
151
|
-
schemathesis-3.33.
|
|
147
|
+
schemathesis-3.33.3.dist-info/METADATA,sha256=KOVSCOFTMZ9DxwahBc2hsx6Qf5XR3SARyyZSnS6atfk,17795
|
|
148
|
+
schemathesis-3.33.3.dist-info/WHEEL,sha256=hKi7AIIx6qfnsRbr087vpeJnrVUuDokDHZacPPMW7-Y,87
|
|
149
|
+
schemathesis-3.33.3.dist-info/entry_points.txt,sha256=VHyLcOG7co0nOeuk8WjgpRETk5P1E2iCLrn26Zkn5uk,158
|
|
150
|
+
schemathesis-3.33.3.dist-info/licenses/LICENSE,sha256=PsPYgrDhZ7g9uwihJXNG-XVb55wj2uYhkl2DD8oAzY0,1103
|
|
151
|
+
schemathesis-3.33.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|