| 12345678910111213141516171819202122232425262728293031323334353637383940414243 | import numpy as npimport subprocessimport sysTEST_BODY = r"""import pytestimport numpy as npfrom numpy.testing import assert_allcloseimport scipyimport sysimport pytestnp.random.seed(1234)x = np.random.randn(10) + 1j * np.random.randn(10)X = np.fft.fft(x)# Callable before scipy.fft is importedwith pytest.deprecated_call(match=r'2\.0\.0'):    y = scipy.ifft(X)assert_allclose(y, x)# Callable after scipy.fft is importedimport scipy.fftwith pytest.deprecated_call(match=r'2\.0\.0'):    y = scipy.ifft(X)assert_allclose(y, x)"""def test_fft_function():    # Historically, scipy.fft was an alias for numpy.fft.fft    # Ensure there are no conflicts with the FFT module (gh-10253)    # Test must run in a subprocess so scipy.fft is not already imported    subprocess.check_call([sys.executable, '-c', TEST_BODY])    # scipy.fft is the correct module    from scipy import fft    assert not callable(fft)    assert fft.__name__ == 'scipy.fft'    from scipy import ifft    assert ifft.__wrapped__ is np.fft.ifft
 |