diff --git a/.drone.yml b/.drone.yml index c2bb84c..692cddd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,12 +12,11 @@ steps: - name: test image: python:3.6 commands: - # Wait for couch - - until curl 'http://couchdb:5984' ; do sleep 1 ; done - # Configure settings - - export HUMULUS_SETTINGS="$(pwd)/testsettings.py" - # Run tests + # Install pre-requisites - pip install coverage pytest - pip install -e . + # Wait for couch + - until curl 'http://couchdb:5984' ; do sleep 1 ; done + # Run tests - coverage run -m pytest - coverage report -m diff --git a/tests/conftest.py b/tests/conftest.py index 6c39411..159e3dd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os import uuid import pytest @@ -22,8 +23,9 @@ from humulus.couch import build_couch, get_couch, put_doc @pytest.fixture def app(): dbname = 'test_{}'.format(str(uuid.uuid4())) + couchurl = os.environ.get('COUCH_URL', 'http://127.0.0.1:5984') app = create_app({ - 'COUCH_URL': 'http://127.0.0.1:5984', + 'COUCH_URL': couchurl, 'COUCH_USERNAME': 'admin', 'COUCH_PASSWORD': 'password', 'COUCH_DATABASE': dbname, diff --git a/testsettings.py b/testsettings.py deleted file mode 100644 index dc4be7e..0000000 --- a/testsettings.py +++ /dev/null @@ -1,5 +0,0 @@ -SECRET_KEY = b'dev' -COUCH_URL='http://couchdb:5984' -COUCH_USERNAME='admin' -COUCH_PASSWORD='password' -COUCH_DATABASE='humulus'