Skip to content

Fix tests for using pytest #140

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 9 commits into from
Jan 29, 2021
Merged

Fix tests for using pytest #140

merged 9 commits into from
Jan 29, 2021

Conversation

1e-to
Copy link
Contributor

@1e-to 1e-to commented Dec 24, 2020

Closes #130

@@ -61,7 +61,7 @@ def driver(a, jitfunc):
return b


def test_driver(input_arr, device_ty, jitfunc):
def case_driver(input_arr, device_ty, jitfunc):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def case_driver(input_arr, device_ty, jitfunc):
def check_driver(input_arr, device_ty, jitfunc):

dppy = numba.njit(reduction)
dppy_result = dppy(a)

ref_result = reduction(a)

np.testing.assert_array_equal(dppy_result, ref_result)
self.assertTrue("Failed to lower parfor on DPPY-device" in msg.getvalue())
assert "Failed to lower parfor on DPPY-device" in str(w[-1].message)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert "Failed to lower parfor on DPPY-device" in str(w[-1].message)
self.assertIn("Failed to lower parfor on DPPY-device", str(w[-1].message)

@@ -4,6 +4,7 @@
import unittest
from numba.tests.support import captured_stderr
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove if not used.

@@ -5,6 +5,7 @@
from numba_dppy.testing import unittest
from numba.tests.support import captured_stderr
Copy link
Contributor

Choose a reason for hiding this comment

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

Used?

self.assertTrue(
"Failed to lower parfor on DPPY-device" in msg_fallback_true.getvalue()
)
assert "Failed to lower parfor on DPPY-device" in str(w[-1].message)
Copy link
Contributor

Choose a reason for hiding this comment

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

assertIn

Copy link
Contributor

@PokhodenkoSA PokhodenkoSA left a comment

Choose a reason for hiding this comment

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

See my new comments.

@PokhodenkoSA
Copy link
Contributor

Thank you @1e-to for the fixes.

@PokhodenkoSA PokhodenkoSA merged commit a1410fe into IntelPython:main Jan 29, 2021
@1e-to 1e-to deleted the pytest branch November 3, 2021 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvements to the Numba-dppy test suite
2 participants