summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-10-20 15:37:36 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-10-20 15:37:36 -0700
commit7ea8e7180c41c1c5b481b949bd53782a96739ae4 (patch)
tree148543ecedc7c81161e3f08f8cd5090dbfe3586c
parent37f6d8a96855f65574f1b03f967501a0f85cc2a3 (diff)
downloadpystache-7ea8e7180c41c1c5b481b949bd53782a96739ae4.tar.gz
Prevent test_pystache.py from expecting spec tests if spec test directory not present.
Prior to this commit, running test_pystache.py from a downloaded sdist has a test failure because the spec tests are not found.
-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 6b463af..184122d 100644
--- a/pystache/tests/main.py
+++ b/pystache/tests/main.py
@@ -1,7 +1,7 @@
# coding: utf-8
"""
-Exposes a run_tests() function that runs all tests in the project.
+Exposes a main() function that runs all tests in the project.
This module is for our test console script.
@@ -104,7 +104,14 @@ def main(sys_argv):
sys_argv.pop(1)
except IndexError:
if should_source_exist:
- spec_test_dir = SPEC_TEST_DIR
+ if not os.path.exists(SPEC_TEST_DIR):
+ # Then the user is probably using a downloaded sdist rather
+ # than a repository clone (since the sdist does not include
+ # the spec test directory).
+ print("pystache: skipping spec tests: spec test directory "
+ "not found")
+ else:
+ spec_test_dir = SPEC_TEST_DIR
try:
# TODO: use optparse command options instead.