Bugs item #3532549, was opened at 2012-06-06 12:38
Message generated for change (Tracker Item Submitted) made by idella
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3532549&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ian Delaney (idella)
Assigned to: Nobody/Anonymous (nobody)
Summary: tests faling in sqlobject-1.3.1
Initial Comment:
first is sqlobject/tests/test_sqlbuilder_joins_instances.py line 36.
assert list(SBAddress.select(AND(SBPerson.q.id==SBAddress.q.personID, SBPerson.q.name=='Julia'))) == \
list(SBPerson.selectBy(name='Julia').throughTo.addresses)
Julia is the second name listed in
mod.ppl = inserts(SBPerson, [('James',),
('Julia',)],
Unless I'm wrong the test data has it wrong. It should have the 1st name and then read through .throughTo.addresses).
Repalcing Julia with James sees the test pass.
Second is similar, line :56.
E assert [<SBAddress 2...' personID=2>] == [<SBAddress 3 ...' personID=2>]
E At index 0 diff: <SBAddress 2 city='Chicago' personID=2> != <SBAddress 3 city='Abu Dhabi' personID=2>
Replacing Jilia with James sees it pass.
Third; sqlobject/tests/test_transactions.py line 27
This 1 is REALLY cute. Run it in isolation;
# PYTHONPATH=.:sqlobject/tests/ py.test sqlobject/tests/test_transactions.py
It passes.
======================================================= 2 failed, 2 passed in 0.23 seconds ==================
run the whole test suite
archtester SQLObject-1.3.1 # PYTHONPATH=.:sqlobject/tests/ py.test sqlobject/tests/
TestSOTrans._connection.autoCommit = 'exception'
TestSOTrans(name='joe', connection=trans)
trans.rollback()
trans.begin()
> assert ([n.name for n in TestSOTrans.select(connection=trans)]
== ['bob','tim'])
E assert [] == ['bob', 'tim']
E Right contains more items, first extra item: 'bob'
sqlobject/tests/test_transactions.py:26: AssertionError
and it fails. go figure.
As for the last two I can't figure what's going on here;
____________________________________________________________ test_transaction_delete ____________________________
close = False
def test_transaction_delete(close=False):
if not supports('transactions'):
return
setupClass(TestSOTrans)
trans = TestSOTrans._connection.transaction()
try:
TestSOTrans(name='bob')
bIn = TestSOTrans.byName('bob', connection=trans)
bIn.destroySelf()
bOut = TestSOTrans.select(TestSOTrans.q.name=='bob')
> assert bOut.count() == 1
E assert 0 == 1
E + where 0 = <bound method SelectResults.count of <SelectResults at 19c9810>>()
E + where <bound method SelectResults.count of <SelectResults at 19c9810>> = <SelectResults at 19c9810>.count
sqlobject/tests/test_transactions.py:64: AssertionError
_______________________________________________________ test_transaction_delete_with_close __________________________
def test_transaction_delete_with_close():
> test_transaction_delete(close=True)
sqlobject/tests/test_transactions.py:76:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
close = True
def test_transaction_delete(close=False):
if not supports('transactions'):
return
setupClass(TestSOTrans)
trans = TestSOTrans._connection.transaction()
try:
TestSOTrans(name='bob')
bIn = TestSOTrans.byName('bob', connection=trans)
bIn.destroySelf()
bOut = TestSOTrans.select(TestSOTrans.q.name=='bob')
> assert bOut.count() == 1
E assert 0 == 1
E + where 0 = <bound method SelectResults.count of <SelectResults at 1ca8c50>>()
E + where <bound method SelectResults.count of <SelectResults at 1ca8c50>> = <SelectResults at 1ca8c50>.count
sqlobject/tests/test_transactions.py:64: AssertionError
set close = True OR False, && it fails. The real problem is in
> assert bOut.count() == 1
E assert 0 == 1
so the error msg indicates assert bOut.count() evaluates to 0.
set assert bOut.count() == 0 and it goes completely carzy reporting an out of index error from another core sqlobject func.
I gather test_transaction_delete failure invokes test_transaction_delete_with_close failure, and I have no idea what
assert bOut.count()
need be set to for success. I can't find a value.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3532549&group_id=74338
|