Commit 31b0dfd8 by Jeremy Bowman

Add LETTUCE_HOST env var

parent 6d68a72e
# lettuce # lettuce
> Version 0.2.23 - kryptonite > Version 0.2.23+edx.1 - kryptonite
[![Build Status](https://secure.travis-ci.org/gabrielfalcao/lettuce.png)](http://travis-ci.org/gabrielfalcao/lettuce) [![Build Status](https://secure.travis-ci.org/gabrielfalcao/lettuce.png)](http://travis-ci.org/gabrielfalcao/lettuce)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = version = '0.2.23' __version__ = version = '0.2.23+edx.1'
release = 'kryptonite' release = 'kryptonite'
......
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from os.path import join, dirname from os.path import join, dirname
try: from django.apps import apps as django_apps
from importlib import import_module
except ImportError:
from django.utils.importlib import import_module
from django.conf import settings from django.conf import settings
...@@ -57,13 +54,7 @@ def get_apps(): ...@@ -57,13 +54,7 @@ def get_apps():
Import Django apps. It ignores ImportErrors. Import Django apps. It ignores ImportErrors.
(Django will take care of it) (Django will take care of it)
""" """
apps = [] return [app_cfg.module for app_cfg in django_apps.get_app_configs()]
for app in settings.INSTALLED_APPS:
try:
apps.append(import_module(app))
except ImportError:
pass
return apps
def harvest_lettuces(only_the_apps=None, avoid_apps=None, path="features"): def harvest_lettuces(only_the_apps=None, avoid_apps=None, path="features"):
......
...@@ -133,6 +133,7 @@ class ThreadedServer(multiprocessing.Process): ...@@ -133,6 +133,7 @@ class ThreadedServer(multiprocessing.Process):
@staticmethod @staticmethod
def get_real_address(address): def get_real_address(address):
address = os.environ.get('LETTUCE_HOST', address)
if address == '0.0.0.0' or address == 'localhost': if address == '0.0.0.0' or address == 'localhost':
address = '127.0.0.1' address = '127.0.0.1'
......
...@@ -36,7 +36,7 @@ if os.name.lower() == 'nt': ...@@ -36,7 +36,7 @@ if os.name.lower() == 'nt':
setup( setup(
name='lettuce', name='lettuce',
version='0.2.23', version='0.2.23+edx.1',
description='Behaviour Driven Development for python', description='Behaviour Driven Development for python',
author='Gabriel Falcao', author='Gabriel Falcao',
author_email='gabriel@nacaolivre.org', author_email='gabriel@nacaolivre.org',
......
...@@ -1276,7 +1276,7 @@ def test_output_background_with_success_colorless(): ...@@ -1276,7 +1276,7 @@ def test_output_background_with_success_colorless():
' Given the variable "X" holds 2 # tests/functional/test_runner.py:{line}\n' ' Given the variable "X" holds 2 # tests/functional/test_runner.py:{line}\n'
'\n' '\n'
' Scenario: multiplication changing the value # tests/functional/bg_features/simple/simple.feature:9\n' ' Scenario: multiplication changing the value # tests/functional/bg_features/simple/simple.feature:9\n'
' Given the variable "X" is equal to 2 # tests/functional/test_runner.py:{line}\n' ' Given the variable "X" is equal to 2 # tests/functional/bg_features/simple/steps.py:5\n'
'\n' '\n'
'1 feature (1 passed)\n' '1 feature (1 passed)\n'
'1 scenario (1 passed)\n' '1 scenario (1 passed)\n'
...@@ -1314,8 +1314,8 @@ def test_output_background_with_success_colorful(): ...@@ -1314,8 +1314,8 @@ def test_output_background_with_success_colorful():
'\033[A\033[1;32m Given the variable "X" holds 2 \033[1;30m# tests/functional/test_runner.py:{line}\033[0m\n' '\033[A\033[1;32m Given the variable "X" holds 2 \033[1;30m# tests/functional/test_runner.py:{line}\033[0m\n'
'\n' '\n'
'\033[1;37m Scenario: multiplication changing the value \033[1;30m# tests/functional/bg_features/simple/simple.feature:9\033[0m\n' '\033[1;37m Scenario: multiplication changing the value \033[1;30m# tests/functional/bg_features/simple/simple.feature:9\033[0m\n'
'\033[1;30m Given the variable "X" is equal to 2 \033[1;30m# tests/functional/test_runner.py:{line}\033[0m\n' '\033[1;30m Given the variable "X" is equal to 2 \033[1;30m# tests/functional/bg_features/simple/steps.py:5\033[0m\n'
'\033[A\033[1;32m Given the variable "X" is equal to 2 \033[1;30m# tests/functional/test_runner.py:{line}\033[0m\n' '\033[A\033[1;32m Given the variable "X" is equal to 2 \033[1;30m# tests/functional/bg_features/simple/steps.py:5\033[0m\n'
'\n' '\n'
'\033[1;37m1 feature (\033[1;32m1 passed\033[1;37m)\033[0m\n' '\033[1;37m1 feature (\033[1;32m1 passed\033[1;37m)\033[0m\n'
'\033[1;37m1 scenario (\033[1;32m1 passed\033[1;37m)\033[0m\n' '\033[1;37m1 scenario (\033[1;32m1 passed\033[1;37m)\033[0m\n'
......
...@@ -23,7 +23,7 @@ from mox import Mox ...@@ -23,7 +23,7 @@ from mox import Mox
def test_has_version(): def test_has_version():
"A nice python module is supposed to have a version" "A nice python module is supposed to have a version"
assert_equals(lettuce.version, '0.2.23') assert_equals(lettuce.version, '0.2.23+edx.1')
def test_has_release(): def test_has_release():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment