diff --git a/.travis.yml b/.travis.yml index ac5914e4..27d587cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,59 +4,20 @@ python: - '2.6' - '2.7' - 'pypy' + install: - pip install -e . -env: - - DB=sqlite:memory - - DB=mysql://root:@localhost/test_w2p - - DB=postgres://postgres:@localhost/test_w2p - - DB=google:datastore -# - DB=google:datastore+ndb - - DB=mongodb://mongodb:mongodb@localhost/test_w2p - - DB=imap://imap:imap@localhost:993 + before_script: - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then pip install unittest2; fi - - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install coverage; fi; - - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install python-coveralls; fi - - if [[ $DB == postgres* ]]; then pip install psycopg2; fi; - - if [[ $TRAVIS_PYTHON_VERSION == '2.5' ]]; then pip install pysqlite; fi - - if [[ $DB == mysql* ]]; then mysql -e 'create database test_w2p;'; fi - - if [[ $DB == postgres* ]]; then psql -c 'create database test_w2p;' -U postgres; fi - - if [[ $DB == postgres* ]]; then psql -c 'create extension postgis;' -U postgres -d test_w2p; fi - - - # Install last sdk for app engine (update only whenever a new release is available) - - if [[ $DB == google* ]]; then wget http://googleappengine.googlecode.com/files/google_appengine_1.8.9.zip -nv; fi - - if [[ $DB == google* ]]; then unzip -q google_appengine_1.8.9.zip; fi - - if [[ $DB == google* ]]; then mv -f ./google_appengine/google ./google; fi - - - if [[ $DB == mongodb* ]]; then pip install pymongo; fi - - if [[ $DB == mongodb* ]]; then mongo test_w2p --eval 'db.addUser("mongodb", "mongodb");'; fi - #Temporal solution to travis issue #155 - sudo chmod 777 /dev/shm - sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm -matrix: - exclude: - - python: 'pypy' - env: DB=postgres://postgres:@localhost/test_w2p - - python: 'pypy' - env: DB=mysql://root:@localhost/test_w2p - - python: 'pypy' - env: DB=google:datastore - - python: '2.6' - env: DB=google:datastore -# - python: '2.6' -# env: DB=google:datastore+ndb - script: export COVERAGE_PROCESS_START=gluon/tests/coverage.ini; ./web2py.py --run_system_tests --with_coverage + after_success: - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coverage combine; fi - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls --config_file=gluon/tests/coverage.ini; fi - + notifications: email: true - -services: mongodb - diff --git a/gluon/globals.py b/gluon/globals.py index 7091f40c..f872864a 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -25,7 +25,6 @@ from gluon.serializers import json, custom_json import gluon.settings as settings from gluon.utils import web2py_uuid, secure_dumps, secure_loads from gluon.settings import global_settings -from gluon.dal import Field from gluon import recfile import hashlib import portalocker @@ -767,6 +766,7 @@ class Session(Storage): compression_level(int): 0-9, sets zlib compression on the data before the encryption """ + from gluon.dal import Field request = request or current.request response = response or current.response masterapp = masterapp or request.application diff --git a/gluon/tests/__init__.py b/gluon/tests/__init__.py index 9d66896e..e2998d1c 100644 --- a/gluon/tests/__init__.py +++ b/gluon/tests/__init__.py @@ -1,4 +1,4 @@ -import os, sys +import sys from test_http import * from test_cache import * @@ -16,16 +16,7 @@ from test_validators import * from test_utils import * from test_contribs import * from test_web import * - +from test_dal import * if sys.version[:3] == '2.7': from test_old_doctests import * - - -NOSQL = any([name in (os.getenv("DB") or "") - for name in ("datastore", "mongodb", "imap")]) - -if NOSQL: - from test_dal_nosql import * -else: - from test_dal import * \ No newline at end of file