Fix for running 'python -m' when using swig -builtin
Same as e05b5ea for -builtin.
Also added runtime tests to check 'python -m'.
This commit is contained in:
parent
9e83d5d5d9
commit
604ae7186b
17 changed files with 155 additions and 9 deletions
|
|
@ -1,6 +1,17 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
print(" Starting subtest " + os.path.basename(__file__))
|
||||
|
||||
# import robin as a module in the global namespace
|
||||
|
||||
import robin
|
||||
print(" Finished importing robin")
|
||||
|
||||
if not(robin.run() == "AWAY!"):
|
||||
raise RuntimeError("test failed")
|
||||
|
||||
commandline = sys.executable + " -m robin"
|
||||
subprocess.check_call(commandline, shell=True)
|
||||
print(" Finished running: " + commandline)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,18 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
print(" Starting subtest " + os.path.basename(__file__))
|
||||
|
||||
# Package brave found under one path
|
||||
sys.path.insert(0, 'path1')
|
||||
|
||||
from brave import robin
|
||||
print(" Finished from brave import robin")
|
||||
|
||||
if not(robin.run() == "AWAY!"):
|
||||
raise RuntimeError("test failed")
|
||||
|
||||
commandline = sys.executable + " -m brave.robin"
|
||||
subprocess.check_call(commandline, shell=True, env = {"PYTHONPATH": "path1"})
|
||||
print(" Finished running: " + commandline)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# These examples rely on namespace packages. Don't
|
||||
# run them for old python interpreters.
|
||||
import sys
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
testname = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
|
||||
print "Testing " + testname + " - namespace packages"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
print(" Starting subtest " + os.path.basename(__file__))
|
||||
|
||||
# Package brave split into two paths.
|
||||
# path2/brave/robin.py and path3/brave/_robin.so
|
||||
sys.path.insert(0, 'path2')
|
||||
sys.path.insert(0, 'path3')
|
||||
|
||||
from brave import robin
|
||||
print(" Finished from brave import robin")
|
||||
|
||||
if not(robin.run() == "AWAY!"):
|
||||
raise RuntimeError("test failed")
|
||||
|
||||
commandline = sys.executable + " -m brave.robin"
|
||||
subprocess.check_call(commandline, shell=True, env = {"PYTHONPATH": "path2:path3"})
|
||||
print(" Finished running: " + commandline)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
print(" Starting subtest " + os.path.basename(__file__))
|
||||
|
||||
# Package brave split into two paths.
|
||||
# brave/robin.py (in path4.zip) and path3/brave/_robin.so
|
||||
sys.path.insert(0, 'path4.zip')
|
||||
sys.path.insert(0, 'path3')
|
||||
|
||||
from brave import robin
|
||||
print(" Finished from brave import robin")
|
||||
|
||||
if not(robin.run() == "AWAY!"):
|
||||
raise RuntimeError("test failed")
|
||||
|
||||
commandline = sys.executable + " -m brave.robin"
|
||||
subprocess.check_call(commandline, shell=True, env = {"PYTHONPATH": "path3:path4.zip"})
|
||||
print(" Finished running: " + commandline)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue