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: GH30999 address all bare pytest.raises in pandas/tests/arrays/boolean/test_arithmetic.py #38849

Conversation

moink
Copy link
Member

@moink moink commented Dec 31, 2020

xref #30999 I thought I was done with the simple bare pytest.raise instances but I somehow missed this test module. Four instances, three fixed by adding match and one by using tm.external_error_raised because I believe the error comes from numpy.

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@@ -46,7 +46,7 @@ def test_add_mul(left_array, right_array, opname, exp):


def test_sub(left_array, right_array):
with pytest.raises(TypeError):
with tm.external_error_raised(TypeError):
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm i actually think showing these errors would be good. yes they might be external, but these are important to see.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok done

@jreback jreback added the Code Style Code style, linting, code_checks label Dec 31, 2020
@jreback jreback added this to the 1.3 milestone Dec 31, 2020
@@ -46,8 +47,11 @@ def test_add_mul(left_array, right_array, opname, exp):


def test_sub(left_array, right_array):
with pytest.raises(TypeError):
# numpy points to ^ operator or logical_xor function instead
msg = re.escape(
Copy link
Contributor

Choose a reason for hiding this comment

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

ok great. yeah these are expected. i don't like the external_ thing because it is not obvious what is happening.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like it much either but it's what the guidance in the issue says to do. shrug

Copy link
Contributor

Choose a reason for hiding this comment

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

hah, that's why I look at all the PRs :->

@jreback jreback merged commit 92ac5e0 into pandas-dev:master Jan 1, 2021
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.

2 participants