From ec9f8ab23cbb9a7b371131c1eb9326bca41456fd Mon Sep 17 00:00:00 2001 From: Matt Basta Date: Tue, 2 Oct 2012 17:15:26 -0700 Subject: [PATCH] Hello, Travis --- .travis.yml | 6 ++++++ appvalidator/constants.py | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7b9b5e9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: python +python: + - "2.6" + - "2.7" +install: "pip install -r requirements.txt --use-mirrors" +script: nosetests \ No newline at end of file diff --git a/appvalidator/constants.py b/appvalidator/constants.py index 6acf2a0..f09c400 100644 --- a/appvalidator/constants.py +++ b/appvalidator/constants.py @@ -21,19 +21,18 @@ MAX_RESOURCE_SIZE = 2 * 1024 * 1024 # Graciously provided by @kumar in bug 614574 if (not SPIDERMONKEY_INSTALLATION or not os.path.exists(SPIDERMONKEY_INSTALLATION)): - for p in os.environ.get('PATH', '').split(':'): + for p in os.environ.get("PATH", "").split(":"): SPIDERMONKEY_INSTALLATION = os.path.join(p, "js") - if os.path.exists(os.path.join(p, SPIDERMONKEY_INSTALLATION)): + if os.path.exists(SPIDERMONKEY_INSTALLATION): break if not os.path.exists(SPIDERMONKEY_INSTALLATION): - - ############ Edit this to change the Spidermonkey location ############# SPIDERMONKEY_INSTALLATION = "/usr/bin/js" - if not os.path.exists(SPIDERMONKEY_INSTALLATION): - # The fallback is simply to disable JS tests. - SPIDERMONKEY_INSTALLATION = None +# The fallback is simply to disable JS tests. +if (not os.path.exists(SPIDERMONKEY_INSTALLATION) or + os.environ.get("TRAVIS", "") == "true"): + SPIDERMONKEY_INSTALLATION = None try: from constants_local import *