diff --git a/test/runtests.py b/test/runtests.py index 86d6122..b65a38e 100644 --- a/test/runtests.py +++ b/test/runtests.py @@ -17,6 +17,9 @@ def getoptionparser(): parser.add_option("-e", "--exclude", type="string", action="append", dest="exclude", default=[], help="exclude tests matching PATTERN", metavar="PATTERN") + parser.add_option("--no-builddir", + action="store_false", dest="builddir", default=True, + help="disable testing from build directory") parser.add_option("--path", type="string", action="append", dest="path", default=[], help="prepend PATH to sys.path", metavar="PATH") @@ -56,7 +59,7 @@ def getbuilddir(): def setup_python(options): rootdir = os.path.dirname(os.path.dirname(__file__)) builddir = os.path.join(rootdir, getbuilddir()) - if os.path.exists(builddir): + if options.builddir and os.path.exists(builddir): sys.path.insert(0, builddir) if options.path: path = options.path[:] diff --git a/tox.ini b/tox.ini index b00b51c..eff59ce 100644 --- a/tox.ini +++ b/tox.ini @@ -16,5 +16,4 @@ envlist = [testenv] deps = commands = - {envpython} setup.py -q clean --all - {envpython} {toxinidir}/test/runtests.py -q + {envpython} {toxinidir}/test/runtests.py --quiet --no-builddir []