aboutsummaryrefslogtreecommitdiff
path: root/Examples/python/import_packages/namespace_pkg/normal.py
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/python/import_packages/namespace_pkg/normal.py')
-rw-r--r--Examples/python/import_packages/namespace_pkg/normal.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/Examples/python/import_packages/namespace_pkg/normal.py b/Examples/python/import_packages/namespace_pkg/normal.py
index fc26c0216..0eb8f517c 100644
--- a/Examples/python/import_packages/namespace_pkg/normal.py
+++ b/Examples/python/import_packages/namespace_pkg/normal.py
@@ -1,7 +1,23 @@
+import os
+import subprocess
import sys
+
+def run_except_on_windows(commandline, env=None):
+ if os.name != "nt" and sys.platform != "cygwin":
+ # Strange failures on windows/cygin/mingw
+ subprocess.check_call(commandline, env=env, shell=True)
+ print(" Finished running: " + commandline)
+
+print(" Starting subtest " + os.path.basename(__file__))
+
# Package brave found under one path
-sys.path.insert(0, 'path1')
+sys.path.insert(0, "path1")
from brave import robin
+print(" Finished from brave import robin")
+
+if not(robin.run() == "AWAY!"):
+ raise RuntimeError("test failed")
-assert(robin.run() == "AWAY!")
+commandline = sys.executable + " -m brave.robin"
+run_except_on_windows(commandline, env = {"PYTHONPATH": "path1"})