[ZODB-Dev] Running the test suite

Tim Peters tim at zope.com
Tue Apr 5 09:59:06 EDT 2005


[Florent Guillaume]
> I'm trying to run the zodb test suite from a trunk checkout.

To be clear, this is what "trunk checkout" means to me:

$ svn info
Path: .
URL: svn+ssh://svnzope/repos/main/ZODB/trunk
Repository UUID: 62d5b8a3-27da-0310-9561-8e5933582275
Revision: 29880
Node Kind: directory
Schedule: normal
Last Changed Author: tim_one
Last Changed Rev: 29880
Last Changed Date: 2005-04-04 22:38:36 -0400 (Mon, 04 Apr 2005)
Properties Last Updated: 2004-06-18 00:39:36 -0400 (Fri, 18 Jun 2004)

Note that the trunk is for ZODB 3.5 development.  Is that what you want?  If
you're writing code for ZODB 3.4, use ZODB/branches/3.4 instead.

> I did "python setup.py build" (but no install) before.
>
> If I run the test with:
>
>    python test.py -vv test_transaction.py
>
> it works buit it tests the one in
> build/lib.linux-i686-2.3/transaction/tests/test_transaction.py.

That looks reasonable given that you did "build".  Here's what it does for
me:

$ \python23\python test.py -vv test_transaction.py
Running unit tests at level 1
Running unit tests from C:\Code\ZODB\build
doctest of transaction.tests.test_transaction.test_join ... ok
testExceptionInAbort (transaction.tests.test_transaction.TransactionTests)
... ok
testExceptionInCommit (transaction.tests.test_transaction.TransactionTests)
... ok
testExceptionInSubAbortSub
(transaction.tests.test_transaction.TransactionTests) ... ok
testExceptionInSubCommitSub
(transaction.tests.test_transaction.TransactionTests) ... ok
testExceptionInTpcAbort
(transaction.tests.test_transaction.TransactionTests) ... ok
testExceptionInTpcBegin
(transaction.tests.test_transaction.TransactionTests) ... ok
testExceptionInTpcVote (transaction.tests.test_transaction.TransactionTests)
... ok
testMultipleSubTransactionCommitAbortSub
(transaction.tests.test_transaction.TransactionTests) ... ok
testMultipleSubTransactionCommitCommit
(transaction.tests.test_transaction.TransactionTests) ... ok
testNSJMultipleSubTransactionCommitCommit
(transaction.tests.test_transaction.TransactionTests) ... ok
testNSJSubTransactionCommitCommit
(transaction.tests.test_transaction.TransactionTests) ... ok
testNSJTransactionAbort
(transaction.tests.test_transaction.TransactionTests) ... ok
testNSJTransactionCommit
(transaction.tests.test_transaction.TransactionTests) ... ok
testSubTransactionCommitAbort
(transaction.tests.test_transaction.TransactionTests) ... ok
testSubTransactionCommitCommit
(transaction.tests.test_transaction.TransactionTests) ... ok
testTransactionAbort (transaction.tests.test_transaction.TransactionTests)
... ok
testTransactionCommit (transaction.tests.test_transaction.TransactionTests)
... ok
testTransactionNote (transaction.tests.test_transaction.TransactionTests)
... ok

----------------------------------------------------------------------
Ran 19 tests in 0.031s

OK
"""

> What I'd like to do is test the one in
> src/transaction/tests/test_transaction.py, that I'm in the process of
> modifying...

"setup.py build" copies that into the build/ tree.

> As it is I do a setup.py build every time before I run the tests

That's easiest to do by passing "-b" to test.py too, like

     python test.py -vvb test_transaction.py
                       ^

"-b" causes test.py to run "setup.py build" before it searches for tests.

> but I'd like to do everything in place.

Then do an in-place build instead, "setup.py build_ext -i".  That probably
won't work if you're using a checkout in the ZODB 3.2 line, but should work
in the ZODB 3.3, 3.4, and trunk lines.  Passing "-B" to test.py causes
test.py to run "setup.py build_ext -i" first.



More information about the ZODB-Dev mailing list