schemathesis 3.35.1__py3-none-any.whl → 3.35.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/_hypothesis.py +12 -14
- schemathesis/cli/__init__.py +424 -412
- schemathesis/cli/context.py +7 -3
- schemathesis/cli/output/default.py +13 -2
- schemathesis/generation/coverage.py +57 -14
- schemathesis/models.py +23 -2
- schemathesis/runner/events.py +6 -1
- schemathesis/runner/impl/core.py +1 -2
- schemathesis/runner/serialization.py +10 -2
- schemathesis/schemas.py +3 -9
- schemathesis/specs/graphql/loaders.py +2 -1
- schemathesis/specs/openapi/links.py +11 -2
- schemathesis/specs/openapi/loaders.py +3 -1
- schemathesis/specs/openapi/parameters.py +16 -9
- schemathesis/stateful/context.py +3 -0
- schemathesis/stateful/runner.py +8 -1
- schemathesis/types.py +8 -0
- {schemathesis-3.35.1.dist-info → schemathesis-3.35.3.dist-info}/METADATA +69 -168
- {schemathesis-3.35.1.dist-info → schemathesis-3.35.3.dist-info}/RECORD +22 -22
- {schemathesis-3.35.1.dist-info → schemathesis-3.35.3.dist-info}/WHEEL +0 -0
- {schemathesis-3.35.1.dist-info → schemathesis-3.35.3.dist-info}/entry_points.txt +0 -0
- {schemathesis-3.35.1.dist-info → schemathesis-3.35.3.dist-info}/licenses/LICENSE +0 -0
schemathesis/_hypothesis.py
CHANGED
|
@@ -50,17 +50,17 @@ def create_test(
|
|
|
50
50
|
auth_storage = get_auth_storage_from_test(test)
|
|
51
51
|
strategies = []
|
|
52
52
|
skip_on_not_negated = len(data_generation_methods) == 1 and DataGenerationMethod.negative in data_generation_methods
|
|
53
|
+
as_strategy_kwargs = as_strategy_kwargs or {}
|
|
54
|
+
as_strategy_kwargs.update(
|
|
55
|
+
{
|
|
56
|
+
"hooks": hook_dispatcher,
|
|
57
|
+
"auth_storage": auth_storage,
|
|
58
|
+
"generation_config": generation_config,
|
|
59
|
+
"skip_on_not_negated": skip_on_not_negated,
|
|
60
|
+
}
|
|
61
|
+
)
|
|
53
62
|
for data_generation_method in data_generation_methods:
|
|
54
|
-
strategies.append(
|
|
55
|
-
operation.as_strategy(
|
|
56
|
-
hooks=hook_dispatcher,
|
|
57
|
-
auth_storage=auth_storage,
|
|
58
|
-
data_generation_method=data_generation_method,
|
|
59
|
-
generation_config=generation_config,
|
|
60
|
-
skip_on_not_negated=skip_on_not_negated,
|
|
61
|
-
**(as_strategy_kwargs or {}),
|
|
62
|
-
)
|
|
63
|
-
)
|
|
63
|
+
strategies.append(operation.as_strategy(data_generation_method=data_generation_method, **as_strategy_kwargs))
|
|
64
64
|
strategy = combine_strategies(strategies)
|
|
65
65
|
_given_kwargs = (_given_kwargs or {}).copy()
|
|
66
66
|
_given_kwargs.setdefault("case", strategy)
|
|
@@ -222,7 +222,6 @@ def _iter_coverage_cases(
|
|
|
222
222
|
)
|
|
223
223
|
generators: dict[tuple[str, str], Generator[coverage.GeneratedValue, None, None]] = {}
|
|
224
224
|
template: dict[str, Any] = {}
|
|
225
|
-
template_generation_method = DataGenerationMethod.positive
|
|
226
225
|
for parameter in operation.iter_parameters():
|
|
227
226
|
schema = parameter.as_json_schema(operation)
|
|
228
227
|
gen = coverage.cover_schema_iter(ctx, schema)
|
|
@@ -236,7 +235,6 @@ def _iter_coverage_cases(
|
|
|
236
235
|
container[name] = json.dumps(value.value)
|
|
237
236
|
else:
|
|
238
237
|
container[name] = value.value
|
|
239
|
-
template_generation_method = value.data_generation_method
|
|
240
238
|
generators[(location, name)] = gen
|
|
241
239
|
if operation.body:
|
|
242
240
|
for body in operation.body:
|
|
@@ -257,9 +255,9 @@ def _iter_coverage_cases(
|
|
|
257
255
|
case.data_generation_method = next_value.data_generation_method
|
|
258
256
|
case.meta = meta
|
|
259
257
|
yield case
|
|
260
|
-
|
|
258
|
+
elif DataGenerationMethod.positive in data_generation_methods:
|
|
261
259
|
case = operation.make_case(**template)
|
|
262
|
-
case.data_generation_method =
|
|
260
|
+
case.data_generation_method = DataGenerationMethod.positive
|
|
263
261
|
case.meta = meta
|
|
264
262
|
yield case
|
|
265
263
|
for (location, name), gen in generators.items():
|