Commits

Brian Curtin committed dd8db32

Build the debug version when running in debug mode

Comments (0)

Files changed (1)

tests/__main__.py

+from os.path import splitext, split
 import subprocess
 import sys
 import unittest
 
 from .test_options import *
 
+EXE = splitext(split(sys.executable)[1])[0]
+DEBUG = EXE[-2:] == "_d"
+
 cwd = os.getcwd()
 os.chdir(os.path.split(__file__)[0])
-subprocess.Popen([sys.executable,
-                  "setup.py", "build", #"--debug", # pull dbg handling in
-                  "install"]).wait()
+args = ["setup.py", "build"]
+args += ["--debug"] if DEBUG else []
+args += ["install"]
+subprocess.Popen([sys.executable] + args).wait()
 os.chdir(cwd)
 
 unittest.main()