summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMartin Reinecke <martin@mpa-garching.mpg.de>2019-01-08 18:41:49 +0100
committerMartin Reinecke <martin@mpa-garching.mpg.de>2019-01-08 18:41:49 +0100
commit4400a93b45e5c8efdb824e798d51c131eae60240 (patch)
tree6c1bea56acab7d5825b9c36adcbbf2987617a3a2 /numpy
parent38b5b7b13d04677a96ce140b6ecb29139f67a453 (diff)
downloadnumpy-4400a93b45e5c8efdb824e798d51c131eae60240.tar.gz
tweak test
Diffstat (limited to 'numpy')
-rw-r--r--numpy/fft/tests/test_pocketfft.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/numpy/fft/tests/test_pocketfft.py b/numpy/fft/tests/test_pocketfft.py
index 89e8df271..1029294a1 100644
--- a/numpy/fft/tests/test_pocketfft.py
+++ b/numpy/fft/tests/test_pocketfft.py
@@ -1,6 +1,7 @@
from __future__ import division, absolute_import, print_function
import numpy as np
+import pytest
from numpy.random import random
from numpy.testing import (
assert_array_almost_equal, assert_array_equal, assert_raises,
@@ -156,13 +157,14 @@ class TestFFT1D(object):
assert_array_almost_equal(x_norm,
np.linalg.norm(tmp))
- def test_dtypes(self):
+ @pytest.mark.parametrize("dtype", [np.half, np.single, np.double,
+ np.longdouble])
+ def test_dtypes(self, dtype):
# make sure that all input precisions are accepted and internally
# converted to 64bit
- for c in "fdg":
- x = random(30).astype(np.dtype(c))
- assert_array_almost_equal(np.fft.ifft(np.fft.fft(x)), x)
- assert_array_almost_equal(np.fft.irfft(np.fft.rfft(x)), x)
+ x = random(30).astype(dtype)
+ assert_array_almost_equal(np.fft.ifft(np.fft.fft(x)), x)
+ assert_array_almost_equal(np.fft.irfft(np.fft.rfft(x)), x)
class TestFFTThreadSafe(object):
threads = 16