From cf931948d6427581f4d459947713ea33dfef6db5 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 24 Sep 2005 04:51:07 +0000 Subject: [PATCH] --- lib/sqlalchemy/schema.py | 1 - lib/sqlalchemy/sql.py | 11 ++++++++--- test/pool.py | 9 +++++---- test/query.py | 1 + 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index ce6dd8c633..8952f038be 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -204,7 +204,6 @@ class ForeignKey(SchemaItem): else: self._column = self._colspec - print "setting up key " + self._column.key + " onto table " + self.parent.table.name self.parent.table.foreign_keys[self._column.key] = self return self._column diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 12666d72a6..56e26b5db6 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -141,6 +141,7 @@ def _compound_select(keyword, *selects, **params): def _is_literal(element): return not isinstance(element, ClauseElement) and not isinstance(element, schema.SchemaItem) + class ClauseVisitor(schema.SchemaVisitor): """builds upon SchemaVisitor to define the visiting of SQL statement elements in addition to Schema elements.""" @@ -568,9 +569,13 @@ class TableImpl(Selectable): as well as other functions """ -# def _engine(self): -# return self.table.engine - + def __init__(self, table): + self.table = table + self.id = self.table.name + + def get_from_text(self): + return self.table.name + def group_parenthesized(self): return False diff --git a/test/pool.py b/test/pool.py index 6de08412d5..c7613eb48e 100644 --- a/test/pool.py +++ b/test/pool.py @@ -16,7 +16,7 @@ class PoolTest(PersistTest): connection2 = manager.connect('foo.db') connection3 = manager.connect('bar.db') - print "connection " + repr(connection) + self.echo( "connection " + repr(connection)) self.assert_(connection.cursor() is not None) self.assert_(connection is connection2) self.assert_(connection2 is not connection3) @@ -27,7 +27,7 @@ class PoolTest(PersistTest): connection = manager.connect('foo.db') connection2 = manager.connect('foo.db') - print "connection " + repr(connection) + self.echo( "connection " + repr(connection)) self.assert_(connection.cursor() is not None) self.assert_(connection is not connection2) @@ -37,7 +37,7 @@ class PoolTest(PersistTest): def status(pool): tup = (pool.size(), pool.checkedin(), pool.overflow(), pool.checkedout()) - print "Pool size: %d Connections in pool: %d Current Overflow: %d Current Checked out connections: %d" % tup + self.echo( "Pool size: %d Connections in pool: %d Current Overflow: %d Current Checked out connections: %d" % tup) return tup c1 = p.connect() @@ -63,7 +63,8 @@ class PoolTest(PersistTest): self.assert_(status(p) == (3, 2, 0, 1)) def tearDown(self): - for file in ('foo.db', 'bar.db'): + pool.clear_managers() + for file in ('foo.db', 'bar.db'): if os.access(file, os.F_OK): os.remove(file) diff --git a/test/query.py b/test/query.py index b9f62b855f..47e56ee162 100644 --- a/test/query.py +++ b/test/query.py @@ -14,6 +14,7 @@ class QueryTest(PersistTest): self.users = Table('users', db, Column('user_id', INT, primary_key = True), Column('user_name', VARCHAR(20)), + redefine = True ) self.users.create() -- 2.47.2