Skip to content

Commit

Permalink
Add option to testrunner
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl committed May 19, 2013
1 parent 323683b commit d08a04f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion test/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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[:]
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

0 comments on commit d08a04f

Please sign in to comment.