Skip to content

Commit

Permalink
Merge pull request cupy#3579 from takagi/fix-helper-negative-value-test
Browse files Browse the repository at this point in the history
Fix negative value test in test_helper
  • Loading branch information
mergify[bot] authored Jul 14, 2020
2 parents 78a83d7 + b8d0b62 commit 92ab7b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/cupy_tests/testing_tests/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,18 @@ def strange_kw_func(self, foo):

class TestIgnoreOfNegativeValueDifferenceOnCpuAndGpu(unittest.TestCase):

@helper.for_unsigned_dtypes('dtype1')
@helper.for_signed_dtypes('dtype2')
@helper.numpy_cupy_allclose()
def correct_failure(self, xp, dtype1, dtype2):
def correct_failure(self, dtype1, dtype2, xp):
if xp == numpy:
return xp.array(-1, dtype=numpy.float32)
else:
return xp.array(-2, dtype=numpy.float32)

def test_correct_failure(self):
@helper.for_unsigned_dtypes('dtype1')
@helper.for_signed_dtypes('dtype2')
def test_correct_failure(self, dtype1, dtype2):
with pytest.raises(AssertionError):
self.correct_failure()
self.correct_failure(dtype1, dtype2)

@helper.for_unsigned_dtypes('dtype1')
@helper.for_signed_dtypes('dtype2')
Expand Down

0 comments on commit 92ab7b4

Please sign in to comment.