summaryrefslogtreecommitdiff
path: root/pystache/tests/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'pystache/tests/main.py')
-rw-r--r--pystache/tests/main.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/pystache/tests/main.py b/pystache/tests/main.py
index 7cfcfeb..5b08471 100644
--- a/pystache/tests/main.py
+++ b/pystache/tests/main.py
@@ -32,10 +32,17 @@ def run_tests(sys_argv):
try:
# TODO: use optparse command options instead.
project_dir = sys_argv[1]
- sys_argv.pop()
+ sys_argv.pop(1)
except IndexError:
project_dir = PROJECT_DIR
+ try:
+ # TODO: use optparse command options instead.
+ spec_test_dir = sys_argv[1]
+ sys_argv.pop(1)
+ except IndexError:
+ spec_test_dir = SPEC_TEST_DIR
+
if len(sys_argv) <= 1 or sys_argv[-1].startswith("-"):
# Then no explicit module or test names were provided, so
# auto-detect all unit tests.
@@ -43,7 +50,7 @@ def run_tests(sys_argv):
sys_argv.extend(module_names)
_PystacheTestProgram._text_doctest_dir = project_dir
- _PystacheTestProgram._spec_test_dir = SPEC_TEST_DIR
+ _PystacheTestProgram._spec_test_dir = spec_test_dir
# We pass None for the module because we do not want the unittest
# module to resolve module names relative to a given module.