Skip to content

TST: Add pytest-instafail to environment.yml #36686

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

Merged
merged 3 commits into from
Sep 29, 2020
Merged

TST: Add pytest-instafail to environment.yml #36686

merged 3 commits into from
Sep 29, 2020

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented Sep 27, 2020

Pretty useful pytest plugin for getting immediate feedback on test failures instead of waiting for an entire test suite to run:

(pandas-dev) ➜  pandas git:(add-pytest-instafail) ✗ pytest pandas/tests/groupby --instafail
============================================================================================ test session starts ============================================================================================
platform darwin -- Python 3.8.5, pytest-6.0.2, py-1.9.0, pluggy-0.13.1
rootdir: /Users/danielsaxton/pandas, configfile: setup.cfg
plugins: hypothesis-5.28.0, forked-1.2.0, asyncio-0.12.0, xdist-2.1.0, cov-2.10.1, instafail-0.4.1
collected 4533 items                                                                                                                                                                                        

pandas/tests/groupby/test_allowlist.py .............................................................................................................................................................. [  3%]
...........................................................                                                                                                                                           [  4%]
pandas/tests/groupby/test_apply.py ............x.x.x...................................................x..........................F

________________________________________________________________________________________________ test_fails _________________________________________________________________________________________________

    def test_fails():
>       assert False
E       assert False

pandas/tests/groupby/test_apply.py:1101: AssertionError

pandas/tests/groupby/test_apply_mutate.py ...                                                                                                                                                         [  6%]
pandas/tests/groupby/test_bin_groupby.py ..........                                                                                                                                                   [  7%]
pandas/tests/groupby/test_categorical.py .....................................................................................xxx..............................sss................................x.. [ 10%]
...

@dsaxton dsaxton added the Testing pandas testing functions or related to the test suite label Sep 27, 2020
@jreback
Copy link
Contributor

jreback commented Sep 27, 2020

is this not exactly what

  -x, --exitfirst       exit instantly on first error or failed test.

does? part of pytest itself

@jreback
Copy link
Contributor

jreback commented Sep 27, 2020

and we do not want to do this in CI builds.

@dsaxton
Copy link
Member Author

dsaxton commented Sep 27, 2020

This continues running the test suite on test failure, only shows the output of failures. In general I think that's a bit more useful than exiting the whole run.

@jreback
Copy link
Contributor

jreback commented Sep 27, 2020

ahh so it shows it as it goes, but still runs the entire thing, ok, that's useful.

@jreback jreback added the CI Continuous Integration label Sep 27, 2020
@jreback jreback added this to the 1.2 milestone Sep 27, 2020
@jbrockmendel
Copy link
Member

LGTM pending green

@jreback jreback merged commit 0db4cfc into pandas-dev:master Sep 29, 2020
@jreback
Copy link
Contributor

jreback commented Sep 29, 2020

thanks @dsaxton

@dsaxton dsaxton deleted the add-pytest-instafail branch September 29, 2020 13:34
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants