You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Schemathesis crashes if OpenAPI schema contains "min_value"
To Reproduce
🚨 Mandatory 🚨: Steps to reproduce the behavior:
TDB. Run st run ... --method PATCH https://<openshift API Server</openapi/v2
Traceback:
PATCH /apis/performance.openshift.io/v1alpha1/performanceprofiles/{name}/status Runtime ErrorHypothesisProvider.draw_string() got an unexpected keyword argument 'min_value'Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/schemathesis/runner/impl/core.py", line 424, in run_testtest(File "/usr/local/lib/python3.12/site-packages/schemathesis/runner/impl/core.py", line 780, in network_testcase: Case,^File "/usr/local/lib/python3.12/site-packages/hypothesis/core.py", line 1638, in wrapped_testraise the_error_hypothesis_foundFile "/usr/local/lib/python3.12/site-packages/hypothesis/core.py", line 1605, in wrapped_teststate.run_engine()File "/usr/local/lib/python3.12/site-packages/hypothesis/core.py", line 1133, in run_enginerunner.run()File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/engine.py", line 713, in runself._run()File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/engine.py", line 1165, in _runself.generate_new_examples()File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/engine.py", line 996, in generate_new_examplesself.test_function(data)File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/engine.py", line 417, in test_functionself.__stoppable_test_function(data)File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/engine.py", line 304, in __stoppable_test_functionself._test_function(data)File "/usr/local/lib/python3.12/site-packages/hypothesis/core.py", line 1056, in _execute_once_for_engineescalate_hypothesis_internal_error()File "/usr/local/lib/python3.12/site-packages/hypothesis/core.py", line 1029, in _execute_once_for_engineresult = self.execute_once(data)^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/core.py", line 946, in execute_onceresult = self.test_runner(data, run)^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/core.py", line 734, in default_executorreturn function(data)^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/core.py", line 857, in runkw, argslices = context.prep_args_kwargs_from_strategies(^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/control.py", line 157, in prep_args_kwargs_from_strategiesobj = check(self.data.draw(s, observe_as=f"generate:{k}"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/data.py", line 2444, in drawreturn strategy.do_draw(self)^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_drawreturn data.draw(self.wrapped_strategy)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/data.py", line 2438, in drawreturn strategy.do_draw(self)^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/strategies/_internal/core.py", line 1761, in do_drawreturn self.definition(data.draw, *self.args, **self.kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/schemathesis/specs/openapi/_hypothesis.py", line 179, in get_case_strategybody_ = ValueContainer(value=draw(strategy), location="body", generator=body_generator)^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/data.py", line 2438, in drawreturn strategy.do_draw(self)^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_drawreturn data.draw(self.wrapped_strategy)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/data.py", line 2438, in drawreturn strategy.do_draw(self)^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/strategies/_internal/core.py", line 1761, in do_drawreturn self.definition(data.draw, *self.args, **self.kwargs)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis_jsonschema/_from_schema.py", line 700, in from_object_schemakey = draw(all_names_strategy.filter(lambda s: s not in out))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/data.py", line 2438, in drawreturn strategy.do_draw(self)^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/strategies/_internal/lazy.py", line 167, in do_drawreturn data.draw(self.wrapped_strategy)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/data.py", line 2438, in drawreturn strategy.do_draw(self)^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/strategies/_internal/strategies.py", line 1006, in do_drawresult = self.do_filtered_draw(data)^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/strategies/_internal/strategies.py", line 1016, in do_filtered_drawvalue = data.draw(self.filtered_strategy)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/data.py", line 2438, in drawreturn strategy.do_draw(self)^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/strategies/_internal/strings.py", line 117, in do_drawreturn data.draw_string(^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.12/site-packages/hypothesis/internal/conjecture/data.py", line 2210, in draw_stringvalue = self.provider.draw_string(^^^^^^^^^^^^^^^^^^^^^^^^^^TypeError: HypothesisProvider.draw_string() got an unexpected keyword argument 'min_value'
while generating 'case' from get_case_strategy(operation=APIOperation(path='/apis/performance.openshift.io/v1alpha1/performanceprofiles/{name}/status', method='patch', schema=<SwaggerV20 for Kubernetes v1.29.5+29c95f3>, verbose_name='PATCH /apis/performance.openshift.io/v1alpha1/performanceprofiles/{name}/status', app=None, base_url='https://api.vrutkovs.devcluster.openshift.com:6443/', path_parameters=ParameterSet(items=[OpenAPI20Parameter(definition={'uniqueItems': True, 'type': 'string', 'description': 'name of the PerformanceProfile', 'name': 'name', 'in': 'path', 'required': True})]), headers=ParameterSet(items=[OpenAPI20Parameter(definition={'name': 'authorization', 'required': True, 'in': 'header', 'type': 'string'})]), cookies=ParameterSet(items=[]), query=ParameterSet(items=[OpenAPI20Parameter(definition={'uniqueItems': True, 'type': 'string', 'description': 'When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed', 'name': 'dryRun', 'in': 'query'}), OpenAPI20Parameter(definition={'uniqueItems': True, 'type': 'string', 'description': 'fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).', 'name': 'fieldManager', 'in': 'query'}), OpenAPI20Parameter(definition={'uniqueItems': True, 'type': 'string', 'description': 'fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.', 'name': 'fieldValidation', 'in': 'query'}), OpenAPI20Parameter(definition={'uniqueItems': True, 'type': 'boolean', 'description': 'Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.', 'name': 'force', 'in': 'query'}), OpenAPI20Parameter(definition={'uniqueItems': True, 'type': 'string', 'description': "If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).", 'name': 'pretty', 'in': 'query'})]), body=PayloadAlternatives(items=[OpenAPI20Body(definition={'name': 'body', 'in': 'body', 'required': True, 'schema': {'type': 'object'}}, media_type='application/json-patch+json'), OpenAPI20Body(definition={'name': 'body', 'in': 'body', 'required': True, 'schema': {'type': 'object'}}, media_type='application/merge-patch+json'), OpenAPI20Body(definition={'name': 'body', 'in': 'body', 'required': True, 'schema': {'type': 'object'}}, media_type='application/apply-patch+yaml')]), case_cls=<class 'schemathesis.models.Case'>), generation_config=GenerationConfig(allow_x00=True, codec='utf-8', headers=HeaderConfig(strategy=None)), headers={}, skip_on_not_negated=False)
Expected behavior
No crashes
Environment
- OS: Linux
- Python version: 3.12
- Schemathesis version: 3.29.2
- Spec version: Open API 2
Additional context
The text was updated successfully, but these errors were encountered:
Thank you so much for reporting! :) I think it is related to the recent changes in Hypothesis, originally I was assuming it was a thread-safety issue, but as far as I see, you don't use the "-w" CLI option, right?
Checklist
Describe the bug
Schemathesis crashes if OpenAPI schema contains "min_value"
To Reproduce
🚨 Mandatory 🚨: Steps to reproduce the behavior:
TDB. Run
st run ... --method PATCH https://<openshift API Server</openapi/v2
Traceback:
Expected behavior
No crashes
Environment
Additional context
The text was updated successfully, but these errors were encountered: