diff options
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | README.unittests | 5 | ||||
-rw-r--r-- | test/__init__.py | 1 | ||||
-rw-r--r-- | test/engine/autoconnect_engine.py | 4 | ||||
-rw-r--r-- | test/engine/proxy_engine.py | 4 | ||||
-rw-r--r-- | test/engine/reflection.py | 4 | ||||
-rw-r--r-- | test/ext/activemapper.py | 3 | ||||
-rw-r--r-- | test/orm/compile.py | 2 | ||||
-rw-r--r-- | test/orm/inheritance2.py | 2 | ||||
-rw-r--r-- | test/orm/inheritance3.py | 3 | ||||
-rw-r--r-- | test/orm/onetoone.py | 2 | ||||
-rw-r--r-- | test/orm/poly_linked_list.py | 2 | ||||
-rw-r--r-- | test/perf/masscreate.py | 2 | ||||
-rw-r--r-- | test/perf/masscreate2.py | 3 | ||||
-rw-r--r-- | test/perf/massload2.py | 5 | ||||
-rw-r--r-- | test/rundocs.py | 1 | ||||
-rw-r--r-- | test/session.py | 7 | ||||
-rw-r--r-- | test/sql/indexes.py | 2 | ||||
-rw-r--r-- | test/sql/select.py | 5 | ||||
-rw-r--r-- | test/sql/testtypes.py | 4 | ||||
-rw-r--r-- | test/testbase.py | 5 |
21 files changed, 37 insertions, 31 deletions
@@ -1,6 +1,8 @@ 0.2.5 - fixed endless loop bug in select_by(), if the traversal hit two mappers that referenced each other +- upgraded all unittests to insert './lib/' into sys.path, +working around new setuptools PYTHONPATH-killing behavior 0.2.4 - try/except when the mapper sets init.__name__ on a mapped class, diff --git a/README.unittests b/README.unittests index 74c7ccac1..1e11873da 100644 --- a/README.unittests +++ b/README.unittests @@ -4,7 +4,10 @@ cd into the SQLAlchemy distribution directory. Set up the PYTHONPATH: - export PYTHONPATH=./lib/:./test/ + export PYTHONPATH=./test/ + +The unittest framework will automatically prepend './lib/' to sys.path. this forces the local +version to run, bypassing any setuptools-installed installations. To run all tests: diff --git a/test/__init__.py b/test/__init__.py index 139597f9c..8b1378917 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,2 +1 @@ - diff --git a/test/engine/autoconnect_engine.py b/test/engine/autoconnect_engine.py index 39bcf3e53..69c2c33f5 100644 --- a/test/engine/autoconnect_engine.py +++ b/test/engine/autoconnect_engine.py @@ -1,8 +1,8 @@ +from testbase import PersistTest +import testbase from sqlalchemy import * from sqlalchemy.ext.proxy import AutoConnectEngine -from testbase import PersistTest -import testbase import os # diff --git a/test/engine/proxy_engine.py b/test/engine/proxy_engine.py index df0c64398..d468e946f 100644 --- a/test/engine/proxy_engine.py +++ b/test/engine/proxy_engine.py @@ -1,10 +1,10 @@ +from testbase import PersistTest +import testbase import os from sqlalchemy import * from sqlalchemy.ext.proxy import ProxyEngine -from testbase import PersistTest -import testbase # # Define an engine, table and mapper at the module level, to show that the diff --git a/test/engine/reflection.py b/test/engine/reflection.py index d4e507464..f9fa4e40c 100644 --- a/test/engine/reflection.py +++ b/test/engine/reflection.py @@ -1,11 +1,11 @@ +from testbase import PersistTest +import testbase import sqlalchemy.ansisql as ansisql from sqlalchemy import * from sqlalchemy.exceptions import NoSuchTableError -from testbase import PersistTest -import testbase import unittest, re, StringIO class ReflectionTest(PersistTest): diff --git a/test/ext/activemapper.py b/test/ext/activemapper.py index f33d3d9bb..ef6886a78 100644 --- a/test/ext/activemapper.py +++ b/test/ext/activemapper.py @@ -1,12 +1,11 @@ +import testbase from sqlalchemy.ext.activemapper import ActiveMapper, column, one_to_many, one_to_one, objectstore from sqlalchemy import and_, or_, clear_mappers from sqlalchemy import ForeignKey, String, Integer, DateTime from datetime import datetime -import unittest import sqlalchemy.ext.activemapper as activemapper -import testbase class testcase(testbase.PersistTest): def setUpAll(self): diff --git a/test/orm/compile.py b/test/orm/compile.py index 007edd596..3268b9230 100644 --- a/test/orm/compile.py +++ b/test/orm/compile.py @@ -1,5 +1,5 @@ -from sqlalchemy import * import testbase +from sqlalchemy import * class CompileTest(testbase.AssertMixin): """test various mapper compilation scenarios""" diff --git a/test/orm/inheritance2.py b/test/orm/inheritance2.py index 9df29f9c9..5ce485ef4 100644 --- a/test/orm/inheritance2.py +++ b/test/orm/inheritance2.py @@ -1,6 +1,6 @@ +import testbase from sqlalchemy import * from datetime import datetime -import testbase class InheritTest(testbase.AssertMixin): """tests some various inheritance round trips involving a particular set of polymorphic inheritance relationships""" diff --git a/test/orm/inheritance3.py b/test/orm/inheritance3.py index eb8ac5a89..6a9765b3a 100644 --- a/test/orm/inheritance3.py +++ b/test/orm/inheritance3.py @@ -1,6 +1,5 @@ -from sqlalchemy import * import testbase - +from sqlalchemy import * class BaseObject(object): def __init__(self, *args, **kwargs): diff --git a/test/orm/onetoone.py b/test/orm/onetoone.py index 5dc5b1204..525c8db7e 100644 --- a/test/orm/onetoone.py +++ b/test/orm/onetoone.py @@ -1,5 +1,5 @@ -from sqlalchemy import * import testbase +from sqlalchemy import * from sqlalchemy.ext.sessioncontext import SessionContext class Jack(object): diff --git a/test/orm/poly_linked_list.py b/test/orm/poly_linked_list.py index 0dfeb3184..527b81148 100644 --- a/test/orm/poly_linked_list.py +++ b/test/orm/poly_linked_list.py @@ -1,5 +1,5 @@ -from sqlalchemy import * import testbase +from sqlalchemy import * class PolymorphicCircularTest(testbase.PersistTest): def setUpAll(self): diff --git a/test/perf/masscreate.py b/test/perf/masscreate.py index 5f99bb6c1..e603e2c00 100644 --- a/test/perf/masscreate.py +++ b/test/perf/masscreate.py @@ -1,4 +1,6 @@ # times how long it takes to create 26000 objects +import sys +sys.path.insert(0, './lib/') from sqlalchemy.attributes import * import time diff --git a/test/perf/masscreate2.py b/test/perf/masscreate2.py index f261f832c..3a68f3612 100644 --- a/test/perf/masscreate2.py +++ b/test/perf/masscreate2.py @@ -1,3 +1,6 @@ +import sys +sys.path.insert(0, './lib/') + import gc import random, string diff --git a/test/perf/massload2.py b/test/perf/massload2.py index 955e2b283..1506ca503 100644 --- a/test/perf/massload2.py +++ b/test/perf/massload2.py @@ -1,3 +1,6 @@ +import sys +sys.path.insert(0, './lib/') + try: # import sqlalchemy.mods.threadlocal pass @@ -70,4 +73,4 @@ print len([s for s in sess]) print "flushing" sess.flush() total = time.time() - now -print "done,total time", total
\ No newline at end of file +print "done,total time", total diff --git a/test/rundocs.py b/test/rundocs.py index 3ed7d815e..1918e55be 100644 --- a/test/rundocs.py +++ b/test/rundocs.py @@ -1,5 +1,6 @@ from sqlalchemy import * import sys +sys.path.insert(0, './lib/') engine = create_engine('sqlite://') diff --git a/test/session.py b/test/session.py deleted file mode 100644 index 9ed7f0f7a..000000000 --- a/test/session.py +++ /dev/null @@ -1,7 +0,0 @@ - -# test merging a composed object. - -# test that when cascading an operation, like "merge", lazy-loaded scalar and list attributes that werent already loaded on the given object remain not loaded. - -# test putting an object in session A, "moving" it to session B, insure its in B and not in A - diff --git a/test/sql/indexes.py b/test/sql/indexes.py index f1e55e406..ec72beda3 100644 --- a/test/sql/indexes.py +++ b/test/sql/indexes.py @@ -1,6 +1,6 @@ +import testbase from sqlalchemy import * import sys -import testbase class IndexTest(testbase.AssertMixin): diff --git a/test/sql/select.py b/test/sql/select.py index d78f36b1a..57b123fc2 100644 --- a/test/sql/select.py +++ b/test/sql/select.py @@ -1,9 +1,8 @@ - +from testbase import PersistTest +import testbase from sqlalchemy import * from sqlalchemy.databases import sqlite, postgres, mysql, oracle -from testbase import PersistTest import unittest, re -import testbase # the select test now tests almost completely with TableClause/ColumnClause objects, # which are free-roaming table/column objects not attached to any database. diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index 2ec1fe795..71c98f105 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -1,7 +1,7 @@ -from sqlalchemy import * -import string,datetime, re, sys from testbase import PersistTest, AssertMixin import testbase +from sqlalchemy import * +import string,datetime, re, sys import sqlalchemy.engine.url as url import sqlalchemy.types diff --git a/test/testbase.py b/test/testbase.py index 0ec494bae..8fbd6954c 100644 --- a/test/testbase.py +++ b/test/testbase.py @@ -1,10 +1,13 @@ +import sys +sys.path.insert(0, './lib/') + import unittest import StringIO import sqlalchemy.engine as engine import sqlalchemy.ext.proxy as proxy import sqlalchemy.pool as pool #import sqlalchemy.schema as schema -import re, sys +import re import sqlalchemy import optparse |