summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests/test_regression.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2019-01-20 11:54:44 -0700
committerGitHub <noreply@github.com>2019-01-20 11:54:44 -0700
commit568d0f7483f7b94029d49707ccd6371f9f5c554c (patch)
tree3e546aae0f0e5d337fd758852b0623c7c1902b4c /numpy/f2py/tests/test_regression.py
parent2b05f3e38431842ff06df9b2958d22c5a0588767 (diff)
parentd26842f9ce822f32b4c6165aff75d950e400beb8 (diff)
downloadnumpy-568d0f7483f7b94029d49707ccd6371f9f5c554c.tar.gz
Merge pull request #12807 from mattip/f2py-source-bytes
BUG, DOC: test, fix that f2py.compile accepts str and bytes, rework docs
Diffstat (limited to 'numpy/f2py/tests/test_regression.py')
-rw-r--r--numpy/f2py/tests/test_regression.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/numpy/f2py/tests/test_regression.py b/numpy/f2py/tests/test_regression.py
index 3adae635d..7b622d5b1 100644
--- a/numpy/f2py/tests/test_regression.py
+++ b/numpy/f2py/tests/test_regression.py
@@ -27,3 +27,17 @@ class TestIntentInOut(util.F2PyTest):
x = np.arange(3, dtype=np.float32)
self.module.foo(x)
assert_equal(x, [3, 1, 2])
+
+@pytest.mark.parametrize('code', [
+ 'program test_f2py\nend program test_f2py',
+ b'program test_f2py\nend program test_f2py',
+ ])
+def test_compile(tmpdir, code):
+ # Make sure we can compile str and bytes gh-12796
+ cwd = os.getcwd()
+ try:
+ os.chdir(str(tmpdir))
+ ret = np.f2py.compile(code, modulename='test1_f2py', extension='.f90')
+ assert_equal(ret, 0)
+ finally:
+ os.chdir(cwd)