From 7ea8e7180c41c1c5b481b949bd53782a96739ae4 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Sat, 20 Oct 2012 15:37:36 -0700 Subject: 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. --- pystache/tests/main.py | 11 +++++++++-- 1 file 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. -- cgit v1.2.1