Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updates to tests, 1 error 10 fails w/apsw right now

  • Loading branch information...
commit b1b378b186f218500a8346ef3e04be64ae0ace10 1 parent 16c2da0
@coleifer authored
Showing with 7 additions and 4 deletions.
  1. +4 −1 extras/apsw_ext.py
  2. +2 −2 peewee.py
  3. +1 −1  tests.py
View
5 extras/apsw_ext.py
@@ -29,7 +29,10 @@ def description(self):
return []
def fetchone(self):
- return self.cursor_obj.next()
+ try:
+ return self.cursor_obj.next()
+ except StopIteration:
+ pass
def fetchmany(self, n):
results = []
View
4 peewee.py
@@ -1459,7 +1459,7 @@ def order_by(self, *clauses):
def exists(self):
clone = self.paginate(1, 1)
clone.query = '(1) AS a'
- curs = self.database.execute(*clone.sql())
+ curs = self.database.execute(*clone.sql(), require_commit=False)
return bool(curs.fetchone())
def get(self, *args, **kwargs):
@@ -1485,7 +1485,7 @@ def annotate(self, related_model, aggregation=None):
def aggregate(self, func):
clone = self.order_by()
clone.query = [func]
- curs = self.database.execute(*clone.sql())
+ curs = self.database.execute(*clone.sql(), require_commit=False)
return curs.fetchone()[0]
@returns_clone
View
2  tests.py
@@ -39,7 +39,7 @@ def emit(self, record):
from extras.apsw_ext import *
database_class = APSWDatabase
database_name = 'tmp.db'
- database_params['timeout'] = 1
+ database_params['timeout'] = 1000
else:
database_class = SqliteDatabase
database_name = 'tmp.db'
Please sign in to comment.
Something went wrong with that request. Please try again.