[SQL-CVS] r4116 - SQLObject/trunk/sqlobject/tests
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2010-03-03 17:02:59
|
Author: phd
Date: 2010-03-03 10:02:52 -0700 (Wed, 03 Mar 2010)
New Revision: 4116
Modified:
SQLObject/trunk/sqlobject/tests/test_pickle.py
Log:
Fixed a test that an instance with a per-instance connection cannot be pickled.
Modified: SQLObject/trunk/sqlobject/tests/test_pickle.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_pickle.py 2010-03-03 16:50:47 UTC (rev 4115)
+++ SQLObject/trunk/sqlobject/tests/test_pickle.py 2010-03-03 17:02:52 UTC (rev 4116)
@@ -23,6 +23,11 @@
assert test.question == test_question
assert test.answer == test_answer
- TestPickle._connection.cache.clear()
- test = TestPickle.get(test.id, connection=TestPickle._connection)
+ connection = TestPickle._connection
+ if (connection.dbName == 'sqlite') and connection._memory:
+ return # The following test requires a different connection
+
+ test = TestPickle.get(test.id,
+ connection=getConnection(registry='')) # to make a different DB URI
+ # and open another connection
raises(pickle.PicklingError, pickle.dumps, test, pickle.HIGHEST_PROTOCOL)
|