Created
June 12, 2012 23:27
-
-
Save bfroehle/2920793 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import nose.tools as nt | |
from IPython.core import oinspect | |
def test_oinspect_f2py(): | |
from numpy import f2py | |
# This is FORTRAN, so the indentation is important: | |
source = \ | |
""" | |
SUBROUTINE HELLO_WORLD | |
c This routine does absolutely nothing! | |
END | |
""" | |
modulename = 'test_oinspect_f2py' | |
try: | |
f2py.compile(source, modulename=modulename) | |
__import__(modulename) | |
mod = sys.modules[modulename] | |
except: | |
# Compilation failed, perhaps because no FORTRAN compiler | |
# was available. | |
pass | |
else: | |
oinspect.find_file(mod.hello_world) | |
if __name__ == "__main__": | |
test_oinspect_f2py() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment