Skip to content
This repository
Browse code

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

  • Loading branch information...
commit b1b378b186f218500a8346ef3e04be64ae0ace10 1 parent 16c2da0
Charles Leifer authored June 28, 2012
5  extras/apsw_ext.py
@@ -29,7 +29,10 @@ def description(self):
29 29
             return []
30 30
 
31 31
     def fetchone(self):
32  
-        return self.cursor_obj.next()
  32
+        try:
  33
+            return self.cursor_obj.next()
  34
+        except StopIteration:
  35
+            pass
33 36
 
34 37
     def fetchmany(self, n):
35 38
         results = []
4  peewee.py
@@ -1459,7 +1459,7 @@ def order_by(self, *clauses):
1459 1459
     def exists(self):
1460 1460
         clone = self.paginate(1, 1)
1461 1461
         clone.query = '(1) AS a'
1462  
-        curs = self.database.execute(*clone.sql())
  1462
+        curs = self.database.execute(*clone.sql(), require_commit=False)
1463 1463
         return bool(curs.fetchone())
1464 1464
 
1465 1465
     def get(self, *args, **kwargs):
@@ -1485,7 +1485,7 @@ def annotate(self, related_model, aggregation=None):
1485 1485
     def aggregate(self, func):
1486 1486
         clone = self.order_by()
1487 1487
         clone.query = [func]
1488  
-        curs = self.database.execute(*clone.sql())
  1488
+        curs = self.database.execute(*clone.sql(), require_commit=False)
1489 1489
         return curs.fetchone()[0]
1490 1490
 
1491 1491
     @returns_clone
2  tests.py
@@ -39,7 +39,7 @@ def emit(self, record):
39 39
     from extras.apsw_ext import *
40 40
     database_class = APSWDatabase
41 41
     database_name = 'tmp.db'
42  
-    database_params['timeout'] = 1
  42
+    database_params['timeout'] = 1000
43 43
 else:
44 44
     database_class = SqliteDatabase
45 45
     database_name = 'tmp.db'

0 notes on commit b1b378b

Please sign in to comment.
Something went wrong with that request. Please try again.