mirror of https://github.com/zulip/zulip.git
lint/tests: Give nice error message for common import failures.
This should make users much more likely to be able to debug issues where they ran Zulip outside the Vagrant environment or virtualenv. [error messages tweaked by tabbott]
This commit is contained in:
parent
0ab6b99cbb
commit
ffb2f9e84b
|
@ -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
|
||||
|
|
|
@ -7,8 +7,13 @@ import sys
|
|||
import optparse
|
||||
import subprocess
|
||||
import traceback
|
||||
|
||||
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',
|
||||
|
|
|
@ -6,9 +6,15 @@ import os
|
|||
import sys
|
||||
import subprocess
|
||||
|
||||
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__))
|
||||
|
|
Loading…
Reference in New Issue