Commits

Mike Bayer  committed cca4941

inserting './lib/' into sys.path since PYTHONPATH no longer straightforward with latest setuptools

  • Participants
  • Parent commits 81142ab

Comments (0)

Files changed (21)

 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,

File README.unittests

 
 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:
 

File test/__init__.py

 
-

File test/engine/autoconnect_engine.py

+from testbase import PersistTest
+import testbase
 from sqlalchemy import *
 from sqlalchemy.ext.proxy import AutoConnectEngine
 
-from testbase import PersistTest
-import testbase
 import os
 
 #

File test/engine/proxy_engine.py

+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

File test/engine/reflection.py

+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):

File test/ext/activemapper.py

+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):

File test/orm/compile.py

+import testbase
 from sqlalchemy import *
-import testbase
 
 class CompileTest(testbase.AssertMixin):
     """test various mapper compilation scenarios"""

File test/orm/inheritance2.py

+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"""

File test/orm/inheritance3.py

+import testbase
 from sqlalchemy import *
-import testbase
-
 
 class BaseObject(object):
     def __init__(self, *args, **kwargs):

File test/orm/onetoone.py

+import testbase
 from sqlalchemy import *
-import testbase
 from sqlalchemy.ext.sessioncontext import SessionContext
 
 class Jack(object):

File test/orm/poly_linked_list.py

+import testbase
 from sqlalchemy import *
-import testbase
 
 class PolymorphicCircularTest(testbase.PersistTest):
     def setUpAll(self):

File test/perf/masscreate.py

 # times how long it takes to create 26000 objects
+import sys
+sys.path.insert(0, './lib/')
 
 from sqlalchemy.attributes import *
 import time

File test/perf/masscreate2.py

+import sys
+sys.path.insert(0, './lib/')
+
 import gc
 
 import random, string

File test/perf/massload2.py

+import sys
+sys.path.insert(0, './lib/')
+
 try:
 #    import sqlalchemy.mods.threadlocal
     pass
 print "flushing"
 sess.flush()
 total = time.time() - now
-print "done,total time", total
+print "done,total time", total

File test/rundocs.py

 from sqlalchemy import *
 import sys
+sys.path.insert(0, './lib/')
 
 engine = create_engine('sqlite://')
 

File test/session.py

-
-# 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
-

File test/sql/indexes.py

+import testbase
 from sqlalchemy import *
 import sys
-import testbase
 
 class IndexTest(testbase.AssertMixin):
     

File test/sql/select.py

-
+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.  

File test/sql/testtypes.py

+from testbase import PersistTest, AssertMixin
+import testbase
 from sqlalchemy import *
 import string,datetime, re, sys
-from testbase import PersistTest, AssertMixin
-import testbase
 import sqlalchemy.engine.url as url
 
 import sqlalchemy.types

File test/testbase.py

+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