8000 ENH: enable OpenBLAS on windows. · Pull Request #9645 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: enable OpenBLAS on windows. #9645

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 13 commits into from Sep 30, 2017
Prev Previous commit
Next Next commit
TST: utils: fix test_error_msg
Allow the error message to contain "large" arrays.
  • Loading branch information
xoviat authored Sep 9, 2017
commit 0957a1fa0afa05d0d8a1a4f54efed46b8a81640b
15 changes: 8 additions & 7 deletions numpy/testing/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,22 @@ def test_complex(self):
self._assert_func(x, x)
self._test_not_equal(x, y)

@dec.knownfailureif(sys.version_info < (3, 0),
msg="Error message different on Python 2")
def test_error_message(self):
try:
self._assert_func(np.array([1, 2]), np.matrix([1, 2]))
except AssertionError as e:
self.assertEqual(
str(e),
"\nArrays are not equal\n\n"
msg = str(e)
msg2 = msg.replace("shapes (2,), (1, 2)", "shapes (2L,), (1L, 2L)")
Copy link
Member

Choose a reason for hiding this comment

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

Arguments the other way around.
Also, the try: except: isn't necessary if you do replacement in str(e).

Copy link
BD32
Author

Choose a reason for hiding this comment

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

I was not thinking here; I copied the replace statement directly from the comment without looking at it myself.

msg_reference = "\nArrays are not equal\n\n"
"(shapes (2,), (1, 2) mismatch)\n"
" x: array([1, 2])\n"
" y: [repr failed for <matrix>: The truth value of an array "
"with more than one element is ambiguous. Use a.any() or "
"a.all()]")

"a.all()]"
try:
self.assertEqual(msg, msg_reference)
except AssertionError:
self.assertEqual(msg2, msg_reference)
Copy link
Member
@pv pv Sep 9, 2017

Choose a reason for hiding this comment

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

The try: except is not needed. You can make it simpler via msg = msg.replace(...)


class TestArrayAlmostEqual(_GenericTest, unittest.TestCase):

Expand Down
0