]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
inserting './lib/' into sys.path since PYTHONPATH no longer straightforward with...
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 29 Jun 2006 00:28:55 +0000 (00:28 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 29 Jun 2006 00:28:55 +0000 (00:28 +0000)
21 files changed:
CHANGES
README.unittests
test/__init__.py
test/engine/autoconnect_engine.py
test/engine/proxy_engine.py
test/engine/reflection.py
test/ext/activemapper.py
test/orm/compile.py
test/orm/inheritance2.py
test/orm/inheritance3.py
test/orm/onetoone.py
test/orm/poly_linked_list.py
test/perf/masscreate.py
test/perf/masscreate2.py
test/perf/massload2.py
test/rundocs.py
test/session.py [deleted file]
test/sql/indexes.py
test/sql/select.py
test/sql/testtypes.py
test/testbase.py

diff --git a/CHANGES b/CHANGES
index 9de4b105bbef365f386b442b35e618cd46839939..5b90beab0e807fc40eb7c7d5cabbde18b6c290b0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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,
index 74c7ccac13e5cdbb86d9ccd8e488a65afae9c820..1e11873da42a8da6b4d5e4db03eca3c0baf82154 100644 (file)
@@ -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:
 
index 139597f9cb07c5d48bed18984ec4747f4b4f3438..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 (file)
@@ -1,2 +1 @@
 
-
index 39bcf3e536ea829410cd3add0262b48f258368e9..69c2c33f5443619e81da0835bbbf0edf7fc4f744 100644 (file)
@@ -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
 
 #
index df0c64398b20ae3b564676eec24df7902ae6d08e..d468e946f2423d02a390c7dbfae0d0945a002c03 100644 (file)
@@ -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
index d4e507464b7eaad21790e4ef02acffcb107915da..f9fa4e40c544c2cf9d7e6477e295bc2a38f91a30 100644 (file)
@@ -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):
index f33d3d9bbd865b7627a0aed40dd7cf947b33cdf8..ef6886a785c1ceb5a01dfbec18ee0e1efc3825ed 100644 (file)
@@ -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):
index 007edd5964c98b28a836f97fa4d3313df70213b3..3268b9230a1d3e400203ba23ff6ffa255abc15df 100644 (file)
@@ -1,5 +1,5 @@
-from sqlalchemy import *
 import testbase
+from sqlalchemy import *
 
 class CompileTest(testbase.AssertMixin):
     """test various mapper compilation scenarios"""
index 9df29f9c9c997b328459a6d027c4b06793da6157..5ce485ef4e05dec6923165f809ed95ac120a3632 100644 (file)
@@ -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"""
index eb8ac5a8965d3715b2e0539b35262d32d8ab8957..6a9765b3ae7779a7d3e687ff05fe0dae52e1ca1c 100644 (file)
@@ -1,6 +1,5 @@
-from sqlalchemy import *
 import testbase
-
+from sqlalchemy import *
 
 class BaseObject(object):
     def __init__(self, *args, **kwargs):
index 5dc5b1204a02f071285e918f29cbefa3eb918213..525c8db7e88a2003355e0df04b46d172f4f0d162 100644 (file)
@@ -1,5 +1,5 @@
-from sqlalchemy import *
 import testbase
+from sqlalchemy import *
 from sqlalchemy.ext.sessioncontext import SessionContext
 
 class Jack(object):
index 0dfeb3184573958c9c24dfec43346188f7cf460f..527b81148d12ce20bb6cc7460629d39528dbec2c 100644 (file)
@@ -1,5 +1,5 @@
-from sqlalchemy import *
 import testbase
+from sqlalchemy import *
 
 class PolymorphicCircularTest(testbase.PersistTest):
     def setUpAll(self):
index 5f99bb6c18ca51c90d7ec9d2c01ba9d339030c30..e603e2c00258a0315c6ec12073d137c7e2c801f8 100644 (file)
@@ -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
index f261f832ce716ed070b0a6ec9c6f0a6e85edb2f8..3a68f3612d62b1cacd8733951cc709d286008918 100644 (file)
@@ -1,3 +1,6 @@
+import sys
+sys.path.insert(0, './lib/')
+
 import gc
 
 import random, string
index 955e2b28310740732feb71bfcacaf8f2175cd18e..1506ca5030e81c82064b97168bd8087652b57b80 100644 (file)
@@ -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
index 3ed7d815ee4028b22d0ab9d33eee167ff25c6fa8..1918e55becd52d3b2028898f57c00fad15719aab 100644 (file)
@@ -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 (file)
index 9ed7f0f..0000000
+++ /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
-
index f1e55e406f31792a74180ec7fc944541ac576880..ec72beda39dd8c9f83564f469a543331873b9ebb 100644 (file)
@@ -1,6 +1,6 @@
+import testbase
 from sqlalchemy import *
 import sys
-import testbase
 
 class IndexTest(testbase.AssertMixin):
     
index d78f36b1add2aea346e98b9cd9db2a029400af9d..57b123fc28dffd26058b2417ab40cfe6bf258b9f 100644 (file)
@@ -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.  
index 2ec1fe7957896afe0f88c99b55a9010d3c3e8fd5..71c98f105b119c6ad6771abb7d1e9dec5f81734e 100644 (file)
@@ -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
index 0ec494bae47b499fe6afadce9ffc3528d36dbceb..8fbd6954c9e275fc4bc63f1b10d0e89f7c501dc0 100644 (file)
@@ -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