Commit b9df2ca
fix: handle OperationDefinition object in Schemathesis 4.x response validation (#18)
* fix: remove method from kwargs and mark tests as ERROR on exceptions
- Remove 'method' from kwargs before passing to auth.request() to fix 'got multiple values' error
- Set test status to ERROR when exceptions occur during test execution
- Fixes issue where all 190 tests were failing but showing as passed
* fix: remove url parameter from kwargs to prevent duplication
The case.as_transport_kwargs() method returns a dictionary that includes
both 'method' and 'url' keys. We already fixed the 'method' duplication
in the previous commit, but 'url' was also causing the same issue.
When we pass path as a positional argument to auth.request(), which then
passes it to httpx.Client.request() as the 'url' parameter, having 'url'
also in **kwargs causes 'got multiple values for argument url' error.
This fix removes both 'method' and 'url' from kwargs before passing to
auth.request() to prevent parameter duplication.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: handle OperationDefinition object in Schemathesis 4.x response validation
In Schemathesis 4.x, operation.definition is an OperationDefinition object,
not a dictionary. The code was calling .get() on it which caused AttributeError.
This fix makes _check_response() defensive by:
1. Checking if definition is a dict or object
2. Accessing responses as dict.get() or object.responses
3. Wrapping in try-except to handle unexpected structures gracefully
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent a949822 commit b9df2ca
1 file changed
+30
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
318 | 330 | | |
319 | 331 | | |
320 | 332 | | |
| |||
0 commit comments