Skip to content
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

TST: Add hook for Disallow bare pytest.raises #38799

Merged
merged 5 commits into from
Jan 3, 2021

Conversation

MarcoGorelli
Copy link
Member

xref #30999

Adding a hook with lots of excluded folders (for now), this can be made stricter as we go along, there's not that much left

@MarcoGorelli MarcoGorelli added the Code Style Code style, linting, code_checks label Dec 30, 2020
entry: python scripts/validate_unwanted_patterns.py --validation-type="bare_pytest_raises"
types: [python]
files: ^pandas/tests/
exclude: ^pandas/tests/(arrays|computation|dtypes|extension|indexes|indexing|io|libs|reductions|resample|reshape|series|window)/
Copy link
Member

@moink moink Dec 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can wait a day or two we can probably get this down to the much shorter list
^pandas/tests/(computation|extension|indexing|io|series)/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure - or, we could get this is now, and then we each PR you submit you narrow it down further?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 4 open PRs: #38720, #38800, #38804, #38805. If we edit this line in each of them they will all have merge conflicts with each other.

After those 4 are closed, I am happy to get this one merged and address this line in each future PR, because what's left are the ones that aren't super straightforward and I might need some help with them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i agree, let's wait on this for a little

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, makes sense - have updated and it's much shorter now, thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are now down to just extension and can merge this, and imo close #30999

@jreback jreback added this to the 1.3 milestone Dec 30, 2020
@jreback
Copy link
Contributor

jreback commented Jan 1, 2021

looks reasonable, can you rebase once more

@jreback jreback merged commit f0908e9 into pandas-dev:master Jan 3, 2021
@jreback
Copy link
Contributor

jreback commented Jan 3, 2021

thanks @MarcoGorelli

@MarcoGorelli MarcoGorelli deleted the disallow-bare-pytest-raises branch January 5, 2021 08:56
@MarcoGorelli
Copy link
Member Author

We are now down to just extension and can merge this, and imo close #30999

@moink sorry I missed this comment - so, computation and io are covered now? If so, do you want to make a PR to remove them from the exclude section of this hook and write closes #30999 in the PR body?

@moink
Copy link
Member

moink commented Jan 5, 2021

We are now down to just extension and can merge this, and imo close #30999

@moink sorry I missed this comment - so, computation and io are covered now? If so, do you want to make a PR to remove them from the exclude section of this hook and write closes #30999 in the PR body?

#38973

luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants