File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2424# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
26+ import pytest
27+
2628import numpy as np
2729
2830import mkl_fft
2931import mkl_fft .interfaces .numpy_fft as _nfft
3032
3133
34+ @pytest .mark .skipif (
35+ np .fft .fft .__module__ != "numpy.fft" ,
36+ reason = "NumPy is already patched by a different library"
37+ )
3238def test_patch ():
3339 mkl_fft .restore_numpy_fft ()
3440 assert not mkl_fft .is_patched ()
35- assert ( np .fft .fft .__module__ == "numpy.fft" )
41+ assert np .fft .fft .__module__ == "numpy.fft"
3642
3743 mkl_fft .patch_numpy_fft () # Enable mkl_fft in Numpy
3844 assert mkl_fft .is_patched ()
39- assert ( np .fft .fft .__module__ == _nfft .fft .__module__ )
45+ assert np .fft .fft .__module__ == _nfft .fft .__module__
4046
4147 mkl_fft .restore_numpy_fft () # Disable mkl_fft in Numpy
4248 assert not mkl_fft .is_patched ()
43- assert ( np .fft .fft .__module__ == "numpy.fft" )
49+ assert np .fft .fft .__module__ == "numpy.fft"
You can’t perform that action at this time.
0 commit comments