Server IP : 66.29.132.122 / Your IP : 18.218.93.169 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/distutils/tests/ |
Upload File : |
from numpy.distutils.from_template import process_str from numpy.testing import assert_equal pyf_src = """ python module foo <_rd=real,double precision> interface subroutine <s,d>foosub(tol) <_rd>, intent(in,out) :: tol end subroutine <s,d>foosub end interface end python module foo """ expected_pyf = """ python module foo interface subroutine sfoosub(tol) real, intent(in,out) :: tol end subroutine sfoosub subroutine dfoosub(tol) double precision, intent(in,out) :: tol end subroutine dfoosub end interface end python module foo """ def normalize_whitespace(s): """ Remove leading and trailing whitespace, and convert internal stretches of whitespace to a single space. """ return ' '.join(s.split()) def test_from_template(): """Regression test for gh-10712.""" pyf = process_str(pyf_src) normalized_pyf = normalize_whitespace(pyf) normalized_expected_pyf = normalize_whitespace(expected_pyf) assert_equal(normalized_pyf, normalized_expected_pyf)