Skip to content

Commit ff63ffb

Browse files
committed
Fix a syntax error in the tests on Python 2.4.
--HG-- extra : convert_revision : svn%3A7a298fb0-333a-0410-83e7-658617cd9cf3/trunk%40161
1 parent 358f43c commit ff63ffb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

couchdb/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright (C) 2007-2008 Christopher Lenz
3+
# Copyright (C) 2007-2009 Christopher Lenz
44
# All rights reserved.
55
#
66
# This software is licensed as described in the file COPYING, which

couchdb/tests/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright (C) 2007 Christopher Lenz
3+
# Copyright (C) 2007-2009 Christopher Lenz
44
# All rights reserved.
55
#
66
# This software is licensed as described in the file COPYING, which
@@ -200,14 +200,16 @@ def test_view_function_objects(self):
200200
for i in range(1, 4):
201201
self.db.create({'i': i, 'j':2*i})
202202

203-
map_fun = lambda doc: (yield doc['i'], doc['j'])
203+
def map_fun(doc):
204+
yield doc['i'], doc['j']
204205
res = list(self.db.query(map_fun, language='python'))
205206
self.assertEqual(3, len(res))
206207
for idx, i in enumerate(range(1,4)):
207208
self.assertEqual(i, res[idx].key)
208209
self.assertEqual(2*i, res[idx].value)
209210

210-
reduce_fun = lambda keys,values,rereduce: sum(values)
211+
def reduce_fun(doc):
212+
return sum(values)
211213
res = list(self.db.query(map_fun, reduce_fun, 'python'))
212214
self.assertEqual(1, len(res))
213215
self.assertEqual(12, res[0].value)

0 commit comments

Comments
 (0)