Skip to content

Commit 599c01e

Browse files
fix: remove method from kwargs and mark tests as ERROR on exceptions (#16)
- 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
1 parent 1026e1f commit 599c01e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/utils/schemathesis_runner.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ def _test_operation(self, operation: Any) -> SchemathesisResult:
242242
"case": self._case_to_dict(case),
243243
}
244244
)
245+
result.status = TestStatus.ERROR
245246

246247
except Exception as e:
247248
result.status = TestStatus.ERROR
@@ -270,16 +271,20 @@ def _execute_case(self, case: Case) -> Any:
270271
# Build request with authentication
271272
kwargs = case.as_transport_kwargs()
272273

274+
# Remove method from kwargs to avoid "got multiple values for argument" error
275+
# since we pass it as a positional argument to auth.request()
276+
kwargs.pop("method", None)
277+
273278
# Add auth headers
274279
headers = kwargs.get("headers", {})
275280
headers.update(self.auth.headers)
276281
kwargs["headers"] = headers
277282

278283
# Make request using auth client
279-
method = case.method.lower()
284+
method = case.method.upper()
280285
path = case.formatted_path
281286

282-
return self.auth.request(method.upper(), path, **kwargs)
287+
return self.auth.request(method, path, **kwargs)
283288

284289
def _check_response(
285290
self,

0 commit comments

Comments
 (0)