swig/Examples/python/import_packages/split_modules/vanilla/runme.py
William S Fulton 604ae7186b Fix for running 'python -m' when using swig -builtin
Same as e05b5ea for -builtin.

Also added runtime tests to check 'python -m'.
2018-12-04 19:12:13 +00:00

17 lines
430 B
Python

import os.path
import subprocess
import sys
testname = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
print "Testing " + testname + " - split modules"
import pkg1.foo
print " Finished importing pkg1.foo"
if not(pkg1.foo.count() == 3):
raise RuntimeError("test failed")
commandline = sys.executable + " -m pkg1.foo"
subprocess.check_call(commandline, shell=True)
print(" Finished running: " + commandline)