| 1 |
PYTHON test_cythonize_no_files.py |
| 2 |
PYTHON test_cython_no_files.py |
| 3 |
|
| 4 |
######## a.py ########### |
| 5 |
a = 1 |
| 6 |
|
| 7 |
######## b.py ########### |
| 8 |
b = 2 |
| 9 |
|
| 10 |
######## c.pyx ########### |
| 11 |
c = 3 |
| 12 |
|
| 13 |
######## d.pyx ########### |
| 14 |
d = 4 |
| 15 |
|
| 16 |
######## test_cythonize_no_files.py ########### |
| 17 |
import subprocess |
| 18 |
import sys |
| 19 |
|
| 20 |
cmd = [sys.executable, '-c', 'from Cython.Build.Cythonize import main; main()', 'a.py', 'b.py', 'c.py', '*.pyx'] |
| 21 |
proc = subprocess.Popen(cmd, stderr=subprocess.PIPE) |
| 22 |
_, err = proc.communicate() |
| 23 |
assert proc.returncode == 1, proc.returncode |
| 24 |
assert b"No such file or directory: 'c.py'" in err, err |
| 25 |
|
| 26 |
######## test_cython_no_files.py ########### |
| 27 |
import subprocess |
| 28 |
import sys |
| 29 |
|
| 30 |
cmd = [sys.executable, '-c', 'from Cython.Compiler.Main import main; main(command_line = 1)', 'a.py', 'b.py', 'c.py', '*.pyx'] |
| 31 |
proc = subprocess.Popen(cmd, stderr=subprocess.PIPE) |
| 32 |
_, err = proc.communicate() |
| 33 |
assert proc.returncode == 1, proc.returncode |
| 34 |
assert b"No such file or directory: 'c.py'" in err, err |