mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
test_server: Improve warning in venv check.
This (1) changes test_server to use the common `check_venv` method and (2) improves check_venv to provide a clearer error message in the case that you're inside Vagrant but not in a venv. Tweaked by tabbott to borrow logic from run_dev.py.
This commit is contained in:
@@ -10,14 +10,12 @@ from contextlib import contextmanager
|
||||
if False:
|
||||
from typing import (Any, Iterator)
|
||||
|
||||
try:
|
||||
import django
|
||||
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)
|
||||
# Verify the Zulip venv is available.
|
||||
from tools.lib import sanity_check
|
||||
sanity_check.check_venv(__file__)
|
||||
|
||||
import django
|
||||
import requests
|
||||
|
||||
TOOLS_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
if TOOLS_DIR not in sys.path:
|
||||
|
||||
Reference in New Issue
Block a user