schemathesis 4.0.0b1__py3-none-any.whl → 4.0.1__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/cli/constants.py +1 -1
- schemathesis/config/_operations.py +16 -21
- schemathesis/core/errors.py +1 -1
- schemathesis/engine/errors.py +1 -1
- {schemathesis-4.0.0b1.dist-info → schemathesis-4.0.1.dist-info}/METADATA +5 -11
- {schemathesis-4.0.0b1.dist-info → schemathesis-4.0.1.dist-info}/RECORD +9 -9
- {schemathesis-4.0.0b1.dist-info → schemathesis-4.0.1.dist-info}/WHEEL +0 -0
- {schemathesis-4.0.0b1.dist-info → schemathesis-4.0.1.dist-info}/entry_points.txt +0 -0
- {schemathesis-4.0.0b1.dist-info → schemathesis-4.0.1.dist-info}/licenses/LICENSE +0 -0
schemathesis/cli/constants.py
CHANGED
@@ -5,4 +5,4 @@ ISSUE_TRACKER_URL = (
|
|
5
5
|
"https://github.com/schemathesis/schemathesis/issues/new?"
|
6
6
|
"labels=Status%3A%20Needs%20Triage%2C+Type%3A+Bug&template=bug_report.md&title=%5BBUG%5D"
|
7
7
|
)
|
8
|
-
EXTENSIONS_DOCUMENTATION_URL = "https://schemathesis.readthedocs.io/en/
|
8
|
+
EXTENSIONS_DOCUMENTATION_URL = "https://schemathesis.readthedocs.io/en/stable/guides/extending/"
|
@@ -159,34 +159,23 @@ class OperationsConfig(DiffBase):
|
|
159
159
|
if exclude_deprecated:
|
160
160
|
exclude_set.include(is_deprecated)
|
161
161
|
|
162
|
-
|
163
|
-
if not include_set.is_empty():
|
164
|
-
self.operations.insert(0, OperationConfig(filter_set=include_set, enabled=True))
|
165
|
-
if not exclude_set.is_empty():
|
166
|
-
self.operations.insert(0, OperationConfig(filter_set=exclude_set, enabled=False))
|
162
|
+
operations = list(self.operations)
|
167
163
|
|
168
164
|
final = FilterSet()
|
169
165
|
|
170
|
-
# Get a stable reference to operations
|
171
|
-
operations = list(self.operations)
|
172
|
-
|
173
|
-
# Define a closure that implements our priority logic
|
174
166
|
def priority_filter(ctx: HasAPIOperation) -> bool:
|
175
167
|
"""Filter operations according to CLI and config priority."""
|
176
|
-
# 1. CLI includes override everything if present
|
177
|
-
if not include_set.is_empty():
|
178
|
-
return include_set.match(ctx)
|
179
|
-
|
180
|
-
# 2. CLI excludes take precedence over config
|
181
|
-
if not exclude_set.is_empty() and exclude_set.match(ctx):
|
182
|
-
return False
|
183
|
-
|
184
|
-
# 3. Check config operations in priority order (first match wins)
|
185
168
|
for op_config in operations:
|
186
|
-
if op_config._filter_set.match(ctx):
|
187
|
-
return
|
169
|
+
if op_config._filter_set.match(ctx) and not op_config.enabled:
|
170
|
+
return False
|
171
|
+
|
172
|
+
if not include_set.is_empty():
|
173
|
+
if exclude_set.is_empty():
|
174
|
+
return include_set.match(ctx)
|
175
|
+
return include_set.match(ctx) and not exclude_set.match(ctx)
|
176
|
+
elif not exclude_set.is_empty():
|
177
|
+
return not exclude_set.match(ctx)
|
188
178
|
|
189
|
-
# 4. Default to include if no rule matches
|
190
179
|
return True
|
191
180
|
|
192
181
|
# Add our priority function as the filter
|
@@ -278,24 +267,30 @@ class OperationConfig(DiffBase):
|
|
278
267
|
@classmethod
|
279
268
|
def from_dict(cls, data: dict[str, Any]) -> OperationConfig:
|
280
269
|
filter_set = FilterSet()
|
270
|
+
seen = set()
|
281
271
|
for key_suffix, arg_suffix in (("", ""), ("-regex", "_regex")):
|
282
272
|
for attr, arg_name in FILTER_ATTRIBUTES:
|
283
273
|
key = f"include-{attr}{key_suffix}"
|
284
274
|
if key in data:
|
275
|
+
seen.add(key)
|
285
276
|
with reraise_filter_error(attr):
|
286
277
|
filter_set.include(**{f"{arg_name}{arg_suffix}": data[key]})
|
287
278
|
key = f"exclude-{attr}{key_suffix}"
|
288
279
|
if key in data:
|
280
|
+
seen.add(key)
|
289
281
|
with reraise_filter_error(attr):
|
290
282
|
filter_set.exclude(**{f"{arg_name}{arg_suffix}": data[key]})
|
291
283
|
for key, method in (("include-by", filter_set.include), ("exclude-by", filter_set.exclude)):
|
292
284
|
if key in data:
|
285
|
+
seen.add(key)
|
293
286
|
expression = data[key]
|
294
287
|
try:
|
295
288
|
func = expression_to_filter_function(expression)
|
296
289
|
method(func)
|
297
290
|
except ValueError:
|
298
291
|
raise ConfigError(f"Invalid filter expression: '{expression}'") from None
|
292
|
+
if not set(data) - seen:
|
293
|
+
raise ConfigError("Operation filters defined, but no settings are being overridden")
|
299
294
|
|
300
295
|
return cls(
|
301
296
|
filter_set=filter_set,
|
schemathesis/core/errors.py
CHANGED
@@ -20,7 +20,7 @@ if TYPE_CHECKING:
|
|
20
20
|
|
21
21
|
|
22
22
|
SCHEMA_ERROR_SUGGESTION = "Ensure that the definition complies with the OpenAPI specification"
|
23
|
-
SERIALIZERS_DOCUMENTATION_URL = "https://schemathesis.readthedocs.io/en/
|
23
|
+
SERIALIZERS_DOCUMENTATION_URL = "https://schemathesis.readthedocs.io/en/stable/guides/custom-serializers/"
|
24
24
|
SERIALIZERS_SUGGESTION_MESSAGE = f"Check your schema or add custom serializers: {SERIALIZERS_DOCUMENTATION_URL}"
|
25
25
|
SERIALIZATION_NOT_POSSIBLE_MESSAGE = f"No supported serializers for media types: {{}}\n{SERIALIZERS_SUGGESTION_MESSAGE}"
|
26
26
|
SERIALIZATION_FOR_TYPE_IS_NOT_POSSIBLE_MESSAGE = (
|
schemathesis/engine/errors.py
CHANGED
@@ -261,7 +261,7 @@ def get_runtime_error_suggestion(error_type: RuntimeErrorKind, bold: Callable[[s
|
|
261
261
|
RuntimeErrorKind.SCHEMA_INVALID_REGULAR_EXPRESSION: "Ensure your regex is compatible with Python's syntax.\n"
|
262
262
|
"For guidance, visit: https://docs.python.org/3/library/re.html",
|
263
263
|
RuntimeErrorKind.HYPOTHESIS_UNSUPPORTED_GRAPHQL_SCALAR: "Define a custom strategy for it.\n"
|
264
|
-
"For guidance, visit: https://schemathesis.readthedocs.io/en/
|
264
|
+
"For guidance, visit: https://schemathesis.readthedocs.io/en/stable/guides/graphql-custom-scalars/",
|
265
265
|
RuntimeErrorKind.HYPOTHESIS_HEALTH_CHECK_DATA_TOO_LARGE: _format_health_check_suggestion("data_too_large"),
|
266
266
|
RuntimeErrorKind.HYPOTHESIS_HEALTH_CHECK_FILTER_TOO_MUCH: _format_health_check_suggestion("filter_too_much"),
|
267
267
|
RuntimeErrorKind.HYPOTHESIS_HEALTH_CHECK_TOO_SLOW: _format_health_check_suggestion("too_slow"),
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: schemathesis
|
3
|
-
Version: 4.0.
|
3
|
+
Version: 4.0.1
|
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
|
-
Project-URL: Changelog, https://
|
6
|
+
Project-URL: Changelog, https://github.com/schemathesis/schemathesis/blob/master/CHANGELOG.md
|
7
7
|
Project-URL: Bug Tracker, https://github.com/schemathesis/schemathesis
|
8
8
|
Project-URL: Funding, https://github.com/sponsors/Stranger6667
|
9
9
|
Project-URL: Source Code, https://github.com/schemathesis/schemathesis
|
@@ -184,27 +184,21 @@ Used by teams at **[Spotify](https://github.com/backstage/backstage)**, **[WordP
|
|
184
184
|
|
185
185
|
## Documentation
|
186
186
|
|
187
|
-
📚 **[Complete documentation](https://schemathesis.readthedocs.io/en/
|
188
|
-
|
189
|
-
> **Note:** See also [docs](https://schemathesis.readthedocs.io/en/stable/) for the stable V3 release
|
187
|
+
📚 **[Complete documentation](https://schemathesis.readthedocs.io/en/stable/)** with guides, examples, and API reference.
|
190
188
|
|
191
189
|
## Get Help
|
192
190
|
|
193
191
|
- 💬 [Discord community](https://discord.gg/R9ASRAmHnA)
|
194
|
-
- 🐛 [GitHub issues](https://github.com/schemathesis/schemathesis/issues)
|
192
|
+
- 🐛 [GitHub issues](https://github.com/schemathesis/schemathesis/issues)
|
195
193
|
|
196
194
|
## Contributing
|
197
195
|
|
198
|
-
We welcome contributions! See our [contributing guidelines](CONTRIBUTING.
|
196
|
+
We welcome contributions! See our [contributing guidelines](CONTRIBUTING.md) and join discussions in [issues](https://github.com/schemathesis/schemathesis/issues) or [Discord](https://discord.gg/R9ASRAmHnA).
|
199
197
|
|
200
198
|
## Acknowledgements
|
201
199
|
|
202
200
|
Schemathesis is built on top of <a href="https://hypothesis.works/" target="_blank">Hypothesis</a>, a powerful property-based testing library for Python.
|
203
201
|
|
204
|
-
---
|
205
|
-
|
206
|
-
> **Note:** This is the V4 development branch. For the stable release, see [V3](https://github.com/schemathesis/schemathesis/tree/v3).
|
207
|
-
|
208
202
|
## License
|
209
203
|
|
210
204
|
This project is licensed under the terms of the [MIT license](https://opensource.org/licenses/MIT).
|
@@ -8,7 +8,7 @@ schemathesis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
schemathesis/schemas.py,sha256=abMMY3nT_lh5siRE3mc5oB6y4rNv2oDJnCE8e5B1pzs,28252
|
9
9
|
schemathesis/cli/__init__.py,sha256=U9gjzWWpiFhaqevPjZbwyTNjABdpvXETI4HgwdGKnvs,877
|
10
10
|
schemathesis/cli/__main__.py,sha256=MWaenjaUTZIfNPFzKmnkTiawUri7DVldtg3mirLwzU8,92
|
11
|
-
schemathesis/cli/constants.py,sha256=
|
11
|
+
schemathesis/cli/constants.py,sha256=CVcQNHEiX-joAQmyuEVKWPOSxDHsOw_EXXZsEclzLuY,341
|
12
12
|
schemathesis/cli/core.py,sha256=ue7YUdVo3YvuzGL4s6i62NL6YqNDeVPBSnQ1znrvG2w,480
|
13
13
|
schemathesis/cli/commands/__init__.py,sha256=rubTCCRGuMIbNYOl8yQEioiuHtTq__tWjkUtFWYGhqQ,3433
|
14
14
|
schemathesis/cli/commands/data.py,sha256=_ALywjIeCZjuaoDQFy-Kj8RZkEGqXd-Y95O47h8Jszs,171
|
@@ -36,7 +36,7 @@ schemathesis/config/_env.py,sha256=8XfIyrnGNQuCDnfG0lwmKRFbasRUjgeQGBAMupsmtOU,6
|
|
36
36
|
schemathesis/config/_error.py,sha256=TxuuqQ1olwJc7P7ssfxXb1dB_Xn5uVsoazjvYvRxrxA,5437
|
37
37
|
schemathesis/config/_generation.py,sha256=_THqCfC20i8RRRsO2hAwoJ52FV-CS1xOA6me3Wp3FHw,5087
|
38
38
|
schemathesis/config/_health_check.py,sha256=zC9inla5ibMBlEy5WyM4_TME7ju_KH3Bwfo21RI3Gks,561
|
39
|
-
schemathesis/config/_operations.py,sha256=
|
39
|
+
schemathesis/config/_operations.py,sha256=EWUFxICG7kzr-yqBeZyZmpwCEMgDkgD7lUXrO_oCLwo,11860
|
40
40
|
schemathesis/config/_output.py,sha256=3G9SOi-4oNcQPHeNRG3HggFCwvcKOW1kF28a9m0H-pU,4434
|
41
41
|
schemathesis/config/_parameters.py,sha256=i76Hwaf834fBAMmtKfKTl1SFCicJ-Y-5tZt5QNGW2fA,618
|
42
42
|
schemathesis/config/_phases.py,sha256=NFUhn-xzEQdNtgNVW1t51lMquXbjRNGR_QuiCRLCi28,6454
|
@@ -51,7 +51,7 @@ schemathesis/core/compat.py,sha256=9BWCrFoqN2sJIaiht_anxe8kLjYMR7t0iiOkXqLRUZ8,1
|
|
51
51
|
schemathesis/core/control.py,sha256=IzwIc8HIAEMtZWW0Q0iXI7T1niBpjvcLlbuwOSmy5O8,130
|
52
52
|
schemathesis/core/curl.py,sha256=yuaCe_zHLGwUjEeloQi6W3tOA3cGdnHDNI17-5jia0o,1723
|
53
53
|
schemathesis/core/deserialization.py,sha256=ygIj4fNaOd0mJ2IvTsn6bsabBt_2AbSLCz-z9UqfpdQ,2406
|
54
|
-
schemathesis/core/errors.py,sha256=
|
54
|
+
schemathesis/core/errors.py,sha256=KuFLy5ZOGn8KlD4ai5HK_WFlB3fJ2rSKwV1yD4fn4BU,16295
|
55
55
|
schemathesis/core/failures.py,sha256=MYyRnom-XeUEuBmq2ffdz34xhxmpSHWaQunfHtliVsY,8932
|
56
56
|
schemathesis/core/fs.py,sha256=ItQT0_cVwjDdJX9IiI7EnU75NI2H3_DCEyyUjzg_BgI,472
|
57
57
|
schemathesis/core/hooks.py,sha256=qhbkkRSf8URJ4LKv2wmKRINKpquUOgxQzWBHKWRWo3Q,475
|
@@ -72,7 +72,7 @@ schemathesis/engine/__init__.py,sha256=QaFE-FinaTAaarteADo2RRMJ-Sz6hZB9TzD5KjMin
|
|
72
72
|
schemathesis/engine/context.py,sha256=x-I9KX6rO6hdCvvN8FEdzIZBqIcNaxdNYHgQjcXbZhM,3931
|
73
73
|
schemathesis/engine/control.py,sha256=QKUOs5VMphe7EcAIro_DDo9ZqdOU6ZVwTU1gMNndHWw,1006
|
74
74
|
schemathesis/engine/core.py,sha256=Pnpf1zNTxruUOnnJ9rQ-MskXj4WuA4A27_fWrf0hXWc,5609
|
75
|
-
schemathesis/engine/errors.py,sha256=
|
75
|
+
schemathesis/engine/errors.py,sha256=cWKuwj0Kzr2BHdVCHACnniUJ8sFVJ0Nqckc3iggZS1o,18800
|
76
76
|
schemathesis/engine/events.py,sha256=VV6epicFIJnX4c87fVNSd0ibDccX3gryDv52OUGa3FI,6370
|
77
77
|
schemathesis/engine/recorder.py,sha256=K3HfMARrT5mPWXPnYebjjcq5CcsBRhMrtZwEL9_Lvtg,8432
|
78
78
|
schemathesis/engine/phases/__init__.py,sha256=zzILnWjoDJQwNmvEmrj3HXVAKT2q7Vb614svjyt8E-U,2794
|
@@ -157,8 +157,8 @@ schemathesis/transport/prepare.py,sha256=c7__wdblBC4zqnmtcs99zoAeEY8jfXiGbdzh74i
|
|
157
157
|
schemathesis/transport/requests.py,sha256=J0j4_9KUBLqgObAklG_Ay62EKdPUeDIcbOMeutl2ctk,9170
|
158
158
|
schemathesis/transport/serialization.py,sha256=igUXKZ_VJ9gV7P0TUc5PDQBJXl_s0kK9T3ljGWWvo6E,10339
|
159
159
|
schemathesis/transport/wsgi.py,sha256=nqmIqYrhC_eqgJSgmDKWz2WSAMFMVVXThJCQLNf1cEQ,5970
|
160
|
-
schemathesis-4.0.
|
161
|
-
schemathesis-4.0.
|
162
|
-
schemathesis-4.0.
|
163
|
-
schemathesis-4.0.
|
164
|
-
schemathesis-4.0.
|
160
|
+
schemathesis-4.0.1.dist-info/METADATA,sha256=Kzo-8LBg_T20kmjJIPntAUY0h6gokghLLjmKyjFinO4,8471
|
161
|
+
schemathesis-4.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
162
|
+
schemathesis-4.0.1.dist-info/entry_points.txt,sha256=hiK3un-xfgPdwj9uj16YVDtTNpO128bmk0U82SMv8ZQ,152
|
163
|
+
schemathesis-4.0.1.dist-info/licenses/LICENSE,sha256=2Ve4J8v5jMQAWrT7r1nf3bI8Vflk3rZVQefiF2zpxwg,1121
|
164
|
+
schemathesis-4.0.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|