From a820842dbfd0fd0b144c88db0f38c45c78951d69 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Tue, 5 Jun 2018 21:45:28 +0200 Subject: [PATCH] Try to fix Travis build --- .travis.yml | 2 +- tests/pytoolbox_runtests.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 68847ade..1cc14b1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ install: - travis_retry sudo pip install --user coveralls script: # - rm -rf django* rest_framework # Not maintained so not testable ... - - python setup.py test + - sudo python setup.py test matrix: allow_failures: - python: 2.6 diff --git a/tests/pytoolbox_runtests.py b/tests/pytoolbox_runtests.py index 5425dc03..ac6157b3 100755 --- a/tests/pytoolbox_runtests.py +++ b/tests/pytoolbox_runtests.py @@ -6,7 +6,6 @@ import os, shutil, tarfile, tempfile import six -from django.conf import settings from pytoolbox.exceptions import BadHTTPResponseCodeError from pytoolbox.network.http import download_ext @@ -17,7 +16,11 @@ def main(): print('Configure Django') - settings.configure() + try: + from django.conf import settings + settings.configure() + except ImportError: + print('WARNING: Django not available for testing purposes') print('Download the test assets') for url, path in constants.TEST_ASSETS: