-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Investigate using Hypothesis for some tests #17978
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
Comments
As another example, I could see Hypothesis being very useful for something like #13432 (buggy index set ops for duplicates, non monotonic, categorical) |
This sounds like it's definitely worth trying! Is there a guarantee that the test cases it produces will always be the same? (Non-reproducible tests could be pretty painful.) |
I believe that once a failing test case is found it's cached (somehow, not
sure on the details.)
…On Wed, Oct 25, 2017 at 10:49 AM, Stephan Hoyer ***@***.***> wrote:
This sounds like it's definitely worth trying! Is there a guarantee that
the test cases it produces will always be the same? (Non-reproducible tests
could be pretty painful.)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#17978 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIvYHXq8I4yFc8irTLznyt0jUidU7ks5sv1h7gaJpZM4QF4u7>
.
|
A test database is kept in a .hypothesis directory. Not sure if that plays nicely with CI. |
@TomAugspurger did this idea ever go anywhere? I'm thinking this might be a useful for testing offsets. |
Don't think so, go for it! |
That seems reasonable. I think the main thing is ensuring this doesn't
increase our test times too much.
…On Tue, Mar 27, 2018 at 12:33 PM, sushobhit27 ***@***.***> wrote:
Hi, Can I work on this issue. I have recently implemented some unit test
cases using hypothesis and therefore have lil bit of exp which I think can
be used here.
Infact I have zeroed in some files, where it can be used easily like
pandas/tests/tools/test_numeric.py, e.g
[image: image]
<https://user-images.githubusercontent.com/31987769/37984121-0dc4695e-3213-11e8-973b-6834195bffd2.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17978 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIh1OvooYADMoaghVQl0p3DGKp1iqks5tinf9gaJpZM4QF4u7>
.
|
Hypothesis test run time depends on mainly 3 things: |
Addition of "hypothesis usage" in test cases of tests/reshape/test_util.py as kind of POC.
@TomAugspurger, I created a pull request #20590 for this issue by adding hypothesis based test cases in just one file. However travis CI build failed with error "ImportError: No module named 'hypothesis'". Could you please check how it (hypothesis module) can be available, so that tests can be run. |
Addition of "hypothesis usage" in test cases of tests/reshape/test_util.py as kind of POC. Incorporate review comments. Resolve flake8 warning.
Addition of "hypothesis usage" in test cases of tests/reshape/test_util.py as kind of POC. Incorporate review comments. Resolve flake8 warning. Add section for hypothesis in contributing.rst
Addition of "hypothesis usage" in test cases of tests/reshape/test_util.py as kind of POC. Incorporate review comments. Resolve flake8 warning. Add section for hypothesis in contributing.rst
moved generic thing to pandas.utils._hypothesis.py. not sure of what exactly was required to change but still tried to change the content as per review comments.
test_empty was failing due to "hypothesis.errors.FailedHealthCheck" error on travis only, therefore decrease the size for lists.
Incorporate review comments.
Incorporate review comments.
Remove hypothesis requirement from *.run files.
Hi all - I'm a maintainer of Hypothesis and happy user of Pandas, so hopefully I can help with this 😄
And my question to Pandas maintainers: what's the best way to add this as a dependency? Hypothesis can be installed from PyPI or from conda-forge, so it's down to whatever would work best in your CI. |
Actually, @Zac-HD would you mind taking a look in #20590? One of the issues we're facing is that none of the pandas maintainers have really used hypothesis before. We're trying to define some best practices in that PR, since others will mimic it. You may be the ideal person to set those standards for pandas :) |
I have three high-level concerns about #20590:
So rather than tread on toes by suggesting detailed edits to those PRs, I might open a third one this weekend incorporating some of both and some of my own notes. |
Hypothesis recently added support for generating pandas objects: http://hypothesis.readthedocs.io/en/latest/numpy.html#pandas
This could be useful for testing some of the higher-level methods like
melt
,merge
, etc.Are there any objections to adding some hypothesis-based tests to our test suite? Is anyone familiar with hypothesis and interested in putting together examples of how we could use it?
The text was updated successfully, but these errors were encountered: