release-engineering/kobo

Task.__lock fails on Python 3

alexandrevicenzi opened this issue · 3 comments

Task.__lock fails when running unit tests on Python 3.

cursor.rowcount always returns -1 on Python 3, on Python 2 it returned the actual rows count affected. Unit tests are using SQLite, but this problem seems to happen with other drivers.

The biggest problem here is that cursor.rowcount is used to raise or not exceptions. We need to fix it or use Django ORM instead of a cursor.

It looks that the tests with XFAIL referencing this issue are passing. Maybe this issue can be closed and xfails removed.

Also I don't see any reason for Py3 to behave differently in the docs.

Hmm... I think those xfails should have been strict, so we would have noticed whichever change caused the tests to start passing. I see a bunch of xpass now which is not ideal.

I think it was fixed in some other component as Travis reported XFAIL on 57f6061 but I got XPASS when testing it locally.