In case anyone is interested, I've made a stab at porting
zope.sqlalchemy to Python 3 at
http://svn.zope.org/zope.sqlalchemy/branches/chrism-py3/ .  Several
tests still fail.  I could use some help fixing them.

To run the test suite:

- Create a Python 3.2 virtualenv.

- Install nose into the virtualenv.

- Check out the "chrism-py3" transaction branch from
  svn://svn.zope.org/repos/main/transaction/branches/chrism-py3

- Install the "chrism-py3" transaction checkout into the virtualenv,
  e.g. $env32/bin/python setup.py develop.

- Install this package into the virtualenv eg. run $env32/bin/python
  setup develop.

- Run $env32/bin/python setup.py nosetests.

Currently 2 tests fail:

 [chrism@thinko zope.sqlalchemy]$ env32/bin/python setup.py test
running test
running egg_info
writing requirements to src/zope.sqlalchemy.egg-info/requires.txt
writing src/zope.sqlalchemy.egg-info/PKG-INFO
writing namespace_packages to
src/zope.sqlalchemy.egg-info/namespace_packages.txt
writing top-level names to src/zope.sqlalchemy.egg-info/top_level.txt
writing dependency_links to
src/zope.sqlalchemy.egg-info/dependency_links.txt
writing manifest file 'src/zope.sqlalchemy.egg-info/SOURCES.txt'
running build_ext
testTwoEngines (zope.sqlalchemy.tests.MultipleEngineTests) ... ok
testRetry (zope.sqlalchemy.tests.RetryTests) ... ERROR
testRetryThread (zope.sqlalchemy.tests.RetryTests) ... ERROR
testAbortAfterCommit (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok
testAbortBeforeCommit (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok
testBulkDelete (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok
testBulkUpdate (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok
testCommit (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok
testCommitWithSavepoint (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ...
ok
testMarkUnknownSession (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ...
ok
testRelations (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok
testRollbackAttributes (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ...
ok
testSavepoint (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok
testSimplePopulation (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok
testThread (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok
testTransactionJoining (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ...
ok
testTwoPhase (zope.sqlalchemy.tests.ZopeSQLAlchemyTests) ... ok

======================================================================
ERROR: testRetry (zope.sqlalchemy.tests.RetryTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1633, in _execute_context
    context)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/default.py",
 line 327, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: test_users

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File
"/home/chrism/projects/zope.sqlalchemy/src/zope/sqlalchemy/tests.py",
line 513, in setUp
    self.tm1.commit()
  File "/home/chrism/projects/transaction/transaction/_manager.py", line
89, in commit
    return self.get().commit()
  File "/home/chrism/projects/transaction/transaction/_transaction.py",
line 342, in commit
    reraise(t, v, tb)
  File "/home/chrism/projects/transaction/transaction/compat.py", line
60, in reraise
    raise value
  File "/home/chrism/projects/transaction/transaction/_transaction.py",
line 333, in commit
    self._commitResources()
  File "/home/chrism/projects/transaction/transaction/_transaction.py",
line 473, in _commitResources
    reraise(t, v, tb)
  File "/home/chrism/projects/transaction/transaction/compat.py", line
60, in reraise
    raise value
  File "/home/chrism/projects/transaction/transaction/_transaction.py",
line 445, in _commitResources
    rm.tpc_begin(self)
  File
"/home/chrism/projects/zope.sqlalchemy/src/zope/sqlalchemy/datamanager.py", 
line 87, in tpc_begin
    self.session.flush()
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/session.py",
 line 1493, in flush
    self._flush(objects)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/session.py",
 line 1562, in _flush
    flush_context.execute()
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/unitofwork.py",
 line 327, in execute
    rec.execute(self)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/unitofwork.py",
 line 471, in execute
    uow
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/mapper.py",
 line 2147, in _save_obj
    execute(statement, multiparams)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1399, in execute
    params)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1532, in _execute_clauseelement
    compiled_sql, distilled_params
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1640, in _execute_context
    context)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1777, in _handle_dbapi_exception
    from e
sqlalchemy.exc.OperationalError: (OperationalError) no such table:
test_users 'INSERT INTO test_users (id, firstname, lastname) VALUES
(?, ?, ?)' (1, 'udo', 'juergens')

======================================================================
ERROR: testRetryThread (zope.sqlalchemy.tests.RetryTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1633, in _execute_context
    context)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/default.py",
 line 327, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: test_users

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File
"/home/chrism/projects/zope.sqlalchemy/src/zope/sqlalchemy/tests.py",
line 513, in setUp
    self.tm1.commit()
  File "/home/chrism/projects/transaction/transaction/_manager.py", line
89, in commit
    return self.get().commit()
  File "/home/chrism/projects/transaction/transaction/_transaction.py",
line 342, in commit
    reraise(t, v, tb)
  File "/home/chrism/projects/transaction/transaction/compat.py", line
60, in reraise
    raise value
  File "/home/chrism/projects/transaction/transaction/_transaction.py",
line 333, in commit
    self._commitResources()
  File "/home/chrism/projects/transaction/transaction/_transaction.py",
line 473, in _commitResources
    reraise(t, v, tb)
  File "/home/chrism/projects/transaction/transaction/compat.py", line
60, in reraise
    raise value
  File "/home/chrism/projects/transaction/transaction/_transaction.py",
line 445, in _commitResources
    rm.tpc_begin(self)
  File
"/home/chrism/projects/zope.sqlalchemy/src/zope/sqlalchemy/datamanager.py", 
line 87, in tpc_begin
    self.session.flush()
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/session.py",
 line 1493, in flush
    self._flush(objects)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/session.py",
 line 1562, in _flush
    flush_context.execute()
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/unitofwork.py",
 line 327, in execute
    rec.execute(self)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/unitofwork.py",
 line 471, in execute
    uow
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/orm/mapper.py",
 line 2147, in _save_obj
    execute(statement, multiparams)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1399, in execute
    params)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1532, in _execute_clauseelement
    compiled_sql, distilled_params
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1640, in _execute_context
    context)
  File
"/home/chrism/projects/zope.sqlalchemy/env32/lib/python3.2/site-packages/SQLAlchemy-0.7.2-py3.2.egg/sqlalchemy/engine/base.py",
 line 1777, in _handle_dbapi_exception
    from e
sqlalchemy.exc.OperationalError: (OperationalError) no such table:
test_users 'INSERT INTO test_users (id, firstname, lastname) VALUES
(?, ?, ?)' (1, 'udo', 'juergens')

----------------------------------------------------------------------
Ran 17 tests in 0.152s

FAILED (errors=2)

This appears to be some sort of Py3+SQLite thing, beacuse if I run the
tests using Postgres isntead of SQLALchemy (after
"env32/bin/easy_install py-postgresql", and then running the tests using
'TEST_DSN="postgresql+pypostgresql://localhost:5432/testing"
env32/bin/python setup.py nosetests' against Postgres 8.4.8 after a
"createdb testing"), I get different failures:

======================================================================
FAIL: testRetryThread (zope.sqlalchemy.tests.RetryTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/chrism/projects/zope.sqlalchemy/src/zope/sqlalchemy/tests.py",
line 564, in testRetryThread
    self.assertTrue(retryable, "Error should be retryable")
AssertionError: None is not true : Error should be retryable
-------------------- >> begin captured logging << --------------------
txn.140333906949888: DEBUG: new transaction
txn.140333906949888: DEBUG: commit
<zope.sqlalchemy.datamanager.SessionDataManager object at 0x2dd6ed0>
txn.140333906949888: DEBUG: commit
txn.140333906949888: DEBUG: new transaction
txn.140333906949888: DEBUG: new transaction
txn.140333906949888: DEBUG: commit
<zope.sqlalchemy.datamanager.SessionDataManager object at 0x2dda9d0>
txn.140333906949888: DEBUG: commit
txn.140333906949888: DEBUG: new transaction
txn.140333906949888: DEBUG: abort
txn.140333906949888: DEBUG: abort
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 18 tests in 5.099s

FAILED (failures=1)


_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to