swig/Examples/python/import_packages/namespace_pkg/nonpkg.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
405 B
Python

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)