diff --git a/frontend_tests/run-casper b/frontend_tests/run-casper index 8f409637bd..f19c8d0416 100755 --- a/frontend_tests/run-casper +++ b/frontend_tests/run-casper @@ -1,12 +1,18 @@ #!/usr/bin/env python from __future__ import print_function import subprocess -import requests import optparse import time import sys import os import glob +try: + import requests +except ImportError as e: + print("ImportError: {}".format(e)) + print("You need to run the Zulip tests inside a Zulip dev environment.") + print("If you are using Vagrant, you can `vagrant ssh` to enter the Vagrant guest.") + sys.exit(1) # # In order to use remote casperjs debugging, pass the --remote-debug flag diff --git a/tools/lint-all b/tools/lint-all index c3976c95c5..dbba33ab50 100755 --- a/tools/lint-all +++ b/tools/lint-all @@ -7,8 +7,13 @@ import sys import optparse import subprocess import traceback - -import lister +try: + import lister +except ImportError as e: + print("ImportError: {}".format(e)) + print("You need to run the Zulip linters inside a Zulip dev environment.") + print("If you are using Vagrant, you can `vagrant ssh` to enter the Vagrant guest.") + sys.exit(1) parser = optparse.OptionParser() parser.add_option('--full', diff --git a/tools/test-backend b/tools/test-backend index c85aaee126..bcff848691 100755 --- a/tools/test-backend +++ b/tools/test-backend @@ -6,9 +6,15 @@ import os import sys import subprocess -import django -from django.conf import settings -from django.test.utils import get_runner +try: + import django + from django.conf import settings + from django.test.utils import get_runner +except ImportError as e: + print("ImportError: {}".format(e)) + print("You need to run the Zulip tests inside a Zulip dev environment.") + print("If you are using Vagrant, you can `vagrant ssh` to enter the Vagrant guest.") + sys.exit(1) if __name__ == "__main__": TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))