New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support hypothesis #475
Comments
I built a simple wrapper that seems to work: def build_mimesis_strategy(mimesis_provider_class, method_name, *args, **kwargs):
"""
Get an attribute from a mimesis provider by seeding with a hypothesis-chosen integer.
"""
provider = mimesis_provider_class()
def get_value(seed):
provider.reseed(seed)
return getattr(provider, method_name)(*args, **kwargs)
return st.integers().map(get_value) Then you can do the following:
|
This issue has been automatically marked as stale because it has not had activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one. |
This issue has been automatically marked as stale because it has not had activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one. |
This issue has been automatically marked as stale because it has not had activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one. |
This issue has been automatically marked as stale because it has not had activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one. |
1 similar comment
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one. |
There's a
faker
plugin to supporthypothesis
.Sometimes I really need to generate some real-world values from
hypothesis
for some fields.For example, there's a trouble with generating URLs for now.
So, we need to create a new library to integrate
mimesis
andhypothesis
together, so I can usemimesis
and notfaker
for these cases.That's how it is currently implemented: https://github.com/HypothesisWorks/hypothesis/blob/01864efb809b1d4e9093bcc3a498ac4b30921047/hypothesis-python/src/hypothesis/extra/fakefactory.py
I have to mention that it is not considered a best practice, but it exists.
This issue should be closed after such package is publicly released.
The text was updated successfully, but these errors were encountered: