Attachment 'py.test-pypy1.6.txt'
Download 1 ============================= test session starts ==============================
2 platform linux2 -- Python 2.7.1[pypy-1.6.0-final] -- pytest-2.2.0
3 collecting ... collected 910 items / 1 errors / 10 skipped
4
5 MoinMoin/_tests/test_error.py ......
6 MoinMoin/_tests/test_sourcecode.py .........................................................................................................................................................................................................................................................................
7 MoinMoin/_tests/test_test_environ.py ..
8 MoinMoin/_tests/test_user.py .........................
9 MoinMoin/_tests/test_wikiutil.py ................
10 MoinMoin/apps/admin/_tests/test_admin.py .......
11 MoinMoin/apps/feed/_tests/test_feed.py ..
12 MoinMoin/apps/frontend/_tests/test_frontend.py ..FF...........................................ssss
13 MoinMoin/apps/misc/_tests/test_misc.py ..
14 MoinMoin/apps/serve/_tests/test_serve.py ..
15 MoinMoin/auth/_tests/test_auth.py ......
16 MoinMoin/auth/_tests/test_http.py .
17 MoinMoin/auth/_tests/test_log.py ...
18 MoinMoin/config/_tests/test_defaultconfig.py .
19 MoinMoin/converter/_tests/test__args.py .......
20 MoinMoin/converter/_tests/test__args_wiki.py ....
21 MoinMoin/converter/_tests/test__wiki_macro.py ....
22 MoinMoin/converter/_tests/test_creole_in.py ..........
23 MoinMoin/converter/_tests/test_include.py ...
24 MoinMoin/converter/_tests/test_link.py ....
25 MoinMoin/converter/_tests/test_mediawiki_in.py ....
26 MoinMoin/converter/_tests/test_moinwiki19_in.py .s.F..........
27 MoinMoin/converter/_tests/test_moinwiki_in.py s.F..........
28 MoinMoin/converter/_tests/test_moinwiki_out.py .........
29 MoinMoin/converter/_tests/test_rst_in.py .........
30 MoinMoin/converter/_tests/test_rst_out.py ...........
31 MoinMoin/converter/_tests/test_smiley.py ssssssss
32 MoinMoin/datastruct/backends/_tests/test_composite_dicts.py ....
33 MoinMoin/datastruct/backends/_tests/test_composite_groups.py .............
34 MoinMoin/datastruct/backends/_tests/test_config_dicts.py .....
35 MoinMoin/datastruct/backends/_tests/test_config_groups.py .........
36 MoinMoin/datastruct/backends/_tests/test_lazy_config_groups.py ..................
37 MoinMoin/datastruct/backends/_tests/test_wiki_dicts.py .....
38 MoinMoin/datastruct/backends/_tests/test_wiki_groups.py .............
39 MoinMoin/i18n/_tests/test_i18n.py ..
40 MoinMoin/items/_tests/test_Item.py .......................
41 MoinMoin/macro/_tests/test_Anchor.py .
42 MoinMoin/macro/_tests/test_Date.py ..
43 MoinMoin/macro/_tests/test_DateTime.py .
44 MoinMoin/macro/_tests/test_GetText.py .
45 MoinMoin/macro/_tests/test_GetVal.py .
46 MoinMoin/macro/_tests/test_Verbatim.py .
47 MoinMoin/macro/_tests/test__base.py ....
48 MoinMoin/mail/_tests/test_sendmail.py .........
49 MoinMoin/search/_tests/test_analyzers.py ...
50 MoinMoin/security/_tests/test_security.py ....................
51 MoinMoin/security/_tests/test_textcha.py ...
52 MoinMoin/security/_tests/test_ticket.py .
53 MoinMoin/storage/backends/_tests/test_fileserver.py ....
54 MoinMoin/storage/backends/_tests/test_stores.py ..........
55 MoinMoin/storage/middleware/_tests/test_indexing.py ...............ss
56 MoinMoin/storage/middleware/_tests/test_protecting.py .............................
57 MoinMoin/storage/middleware/_tests/test_routing.py .....
58 MoinMoin/storage/middleware/_tests/test_serialization.py .
59 MoinMoin/storage/stores/_tests/test_all.py ..ss......ss..ss......ss..ss......ss..ss..FFFFss..ss......ssssssssssssss
60 MoinMoin/storage/stores/_tests/test_fs.py ......
61 MoinMoin/storage/stores/_tests/test_memory.py ......
62 MoinMoin/storage/stores/_tests/test_sqlite.py ..........
63 MoinMoin/themes/_tests/test_navi_bar.py .....
64 MoinMoin/util/_tests/test_crypto.py ........
65 MoinMoin/util/_tests/test_diff3.py .
66 MoinMoin/util/_tests/test_diff_html.py ..
67 MoinMoin/util/_tests/test_diff_text.py .
68 MoinMoin/util/_tests/test_filesys.py ....s........
69 MoinMoin/util/_tests/test_forms.py ......
70 MoinMoin/util/_tests/test_interwiki.py .....
71 MoinMoin/util/_tests/test_iri.py ..................
72 MoinMoin/util/_tests/test_lock.py .............
73 MoinMoin/util/_tests/test_md5crypt.py ..
74 MoinMoin/util/_tests/test_mime.py .....
75 MoinMoin/util/_tests/test_mimetype.py ...
76 MoinMoin/util/_tests/test_paramparser.py .......................F..
77 MoinMoin/util/_tests/test_pysupport.py ...ss
78 MoinMoin/util/_tests/test_registry.py ..
79 MoinMoin/util/_tests/test_send_file.py .
80 MoinMoin/util/_tests/test_tree.py ....
81 MoinMoin/util/_tests/test_util.py .
82 MoinMoin/util/_tests/test_version.py .
83
84 ==================================== ERRORS ====================================
85 _________ ERROR collecting MoinMoin/util/_tests/test_thread_monitor.py _________
86 MoinMoin/util/_tests/test_thread_monitor.py:13: in <module>
87 > from MoinMoin.util.thread_monitor import Monitor
88 MoinMoin/util/thread_monitor.py:63: in <module>
89 > mon = Monitor()
90 MoinMoin/util/thread_monitor.py:26: in __init__
91 > assert hasattr(sys, "_current_frames") # make sure we have py >= 2.5
92 E assert hasattr(sys, '_current_frames')
93 =================================== FAILURES ===================================
94 ________________ TestFrontend.test_ajaxdestroy_item_name_route _________________
95
96 self = <test_frontend.TestFrontend object at 0x000000000ddcc838>
97
98 def test_ajaxdestroy_item_name_route(self):
99 self._test_view_post('frontend.ajaxdestroy', status='200 OK', content_types=['application/json', ], data=['{', '}'], form=dict(
100 comment='Test',
101 itemnames='["DoesntExist"]',
102 > ), viewopts=dict(item_name='DoesntExist'))
103
104 MoinMoin/apps/frontend/_tests/test_frontend.py:68:
105 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
106
107 self = <test_frontend.TestFrontend object at 0x000000000ddcc838>
108 viewname = 'frontend.ajaxdestroy', status = '200 OK'
109 content_types = ['application/json'], data = ['{', '}']
110 form = {'comment': 'Test', 'itemnames': '["DoesntExist"]'}
111 viewopts = {'item_name': 'DoesntExist'}
112
113 def _test_view_post(self, viewname, status='302 FOUND', content_types=('text/html; charset=utf-8', ), data=('<html>', '</html>'), form=None, viewopts=None):
114 if viewopts is None:
115 viewopts = {}
116 if form is None:
117 form = {}
118 print 'POST %s' % url_for(viewname, **viewopts)
119 with self.app.test_client() as c:
120 rv = c.post(url_for(viewname, **viewopts), data=form)
121 > assert rv.status == status
122 E assert '500 INTERNAL SERVER ERROR' == '200 OK'
123 E - 500 INTERNAL SERVER ERROR
124 E + 200 OK
125
126 MoinMoin/apps/frontend/_tests/test_frontend.py:46: AssertionError
127 ------------------------------- Captured stdout --------------------------------
128 POST /+ajaxdestroy/DoesntExist
129 ------------------------------- Captured stderr --------------------------------
130 2011-12-15 15:49:03,500 ERROR MoinMoin:1210 Exception on /+ajaxdestroy/DoesntExist [POST]
131 Traceback (most recent call last):
132 File "/home/moin/moin-2.0/env-pypy-1.6/site-packages/flask/app.py", line 1504, in wsgi_app
133 response = self.full_dispatch_request()
134 File "/home/moin/moin-2.0/env-pypy-1.6/site-packages/flask/app.py", line 1264, in full_dispatch_request
135 rv = self.handle_user_exception(e)
136 File "/home/moin/moin-2.0/env-pypy-1.6/site-packages/flask/app.py", line 1262, in full_dispatch_request
137 rv = self.dispatch_request()
138 File "/home/moin/moin-2.0/env-pypy-1.6/site-packages/flask/app.py", line 1248, in dispatch_request
139 return self.view_functions[rule.endpoint](**req.view_args)
140 File "/home/moin/moin-2.0/MoinMoin/apps/frontend/views.py", line 546, in ajaxdestroy
141 item.destroy(comment=comment, destroy_item=True)
142 File "/home/moin/moin-2.0/MoinMoin/items/__init__.py", line 410, in destroy
143 self.rev.item.destroy_all_revisions()
144 AttributeError: 'DummyItem' object has no attribute 'destroy_all_revisions'
145 _______________ TestFrontend.test_ajaxdestroy_no_item_name_route _______________
146
147 self = <test_frontend.TestFrontend object at 0x000000000df79830>
148
149 def test_ajaxdestroy_no_item_name_route(self):
150 self._test_view_post('frontend.ajaxdestroy', status='200 OK', content_types=['application/json', ], data=['{', '}'], form=dict(
151 comment='Test',
152 > itemnames='["DoesntExist"]',
153
154 MoinMoin/apps/frontend/_tests/test_frontend.py:73:
155 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
156
157 self = <test_frontend.TestFrontend object at 0x000000000df79830>
158 viewname = 'frontend.ajaxdestroy', status = '200 OK'
159 content_types = ['application/json'], data = ['{', '}']
160 form = {'comment': 'Test', 'itemnames': '["DoesntExist"]'}, viewopts = {}
161
162 def _test_view_post(self, viewname, status='302 FOUND', content_types=('text/html; charset=utf-8', ), data=('<html>', '</html>'), form=None, viewopts=None):
163 if viewopts is None:
164 viewopts = {}
165 if form is None:
166 form = {}
167 print 'POST %s' % url_for(viewname, **viewopts)
168 with self.app.test_client() as c:
169 rv = c.post(url_for(viewname, **viewopts), data=form)
170 > assert rv.status == status
171 E assert '500 INTERNAL SERVER ERROR' == '200 OK'
172 E - 500 INTERNAL SERVER ERROR
173 E + 200 OK
174
175 MoinMoin/apps/frontend/_tests/test_frontend.py:46: AssertionError
176 ------------------------------- Captured stdout --------------------------------
177 POST /+ajaxdestroy
178 ------------------------------- Captured stderr --------------------------------
179 2011-12-15 15:49:03,576 ERROR MoinMoin:1210 Exception on /+ajaxdestroy [POST]
180 Traceback (most recent call last):
181 File "/home/moin/moin-2.0/env-pypy-1.6/site-packages/flask/app.py", line 1504, in wsgi_app
182 response = self.full_dispatch_request()
183 File "/home/moin/moin-2.0/env-pypy-1.6/site-packages/flask/app.py", line 1264, in full_dispatch_request
184 rv = self.handle_user_exception(e)
185 File "/home/moin/moin-2.0/env-pypy-1.6/site-packages/flask/app.py", line 1262, in full_dispatch_request
186 rv = self.dispatch_request()
187 File "/home/moin/moin-2.0/env-pypy-1.6/site-packages/flask/app.py", line 1248, in dispatch_request
188 return self.view_functions[rule.endpoint](**req.view_args)
189 File "/home/moin/moin-2.0/MoinMoin/apps/frontend/views.py", line 546, in ajaxdestroy
190 item.destroy(comment=comment, destroy_item=True)
191 File "/home/moin/moin-2.0/MoinMoin/items/__init__.py", line 410, in destroy
192 self.rev.item.destroy_all_revisions()
193 AttributeError: 'DummyItem' object has no attribute 'destroy_all_revisions'
194 _____________________ TestConverterFormat19.test_emphasis ______________________
195
196 self = <MoinMoin.converter._tests.test_moinwiki19_in.TestConverterFormat19 object at 0x000000000eaea720>
197 input = "'''''Mixed'''Emphasis''"
198 output = '<page><body><p><emphasis><strong>Mixed</strong>Emphasis</emphasis></p></body></page>'
199 args = {}, skip = None
200
201 def do(self, input, output, args={}, skip=None):
202 if skip:
203 pytest.skip(skip)
204 out = self.conv(input, 'text/x.moin.wiki;charset=utf-8', **args)
205 > assert self.serialize(out) == output
206 E assert u'<page><body.../body></page>' == '<page><body><.../body></page>'
207 E - <page><body><p><strong><emphasis>Mixed<strong>Emphasis<emphasis /></strong></emphasis></strong></p></body></page>
208 E ? -------- --------------------- ---------
209 E + <page><body><p><emphasis><strong>Mixed</strong>Emphasis</emphasis></p></body></page>
210 E ? ++++++++ +
211
212 MoinMoin/converter/_tests/test_moinwiki_in.py:317: AssertionError
213 _________________________ TestConverter.test_emphasis __________________________
214
215 self = <MoinMoin.converter._tests.test_moinwiki_in.TestConverter object at 0x000000000fac4fe0>
216 input = "'''''Mixed'''Emphasis''"
217 output = '<page><body><p><emphasis><strong>Mixed</strong>Emphasis</emphasis></p></body></page>'
218 args = {}, skip = None
219
220 def do(self, input, output, args={}, skip=None):
221 if skip:
222 pytest.skip(skip)
223 out = self.conv(input, 'text/x.moin.wiki;charset=utf-8', **args)
224 > assert self.serialize(out) == output
225 E assert u'<page><body.../body></page>' == '<page><body><.../body></page>'
226 E - <page><body><p><strong><emphasis>Mixed<strong>Emphasis<emphasis /></strong></emphasis></strong></p></body></page>
227 E ? -------- --------------------- ---------
228 E + <page><body><p><emphasis><strong>Mixed</strong>Emphasis</emphasis></p></body></page>
229 E ? ++++++++ +
230
231 MoinMoin/converter/_tests/test_moinwiki_in.py:317: AssertionError
232 _________________________ test_iter[sqlite/BytesStore] _________________________
233
234 store = <MoinMoin.storage.stores.sqlite.BytesStore object at 0x0000000016c27c58>
235
236 def test_iter(store):
237 kvs = set([('1', 'one'), ('2', 'two'), ('3', 'three'), ])
238 for k, v in kvs:
239 store[k] = v
240 result = set()
241 > for k in store:
242
243 MoinMoin/storage/stores/_tests/test_all.py:42:
244 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
245
246 self = <MoinMoin.storage.stores.sqlite.BytesStore object at 0x0000000016c27c58>
247
248 def __iter__(self):
249 > for row in self.conn.execute("select key from {0}".format(self.table_name)):
250
251 MoinMoin/storage/stores/sqlite.py:77:
252 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
253
254 self = <_sqlite3.Statement object at 0x0000000016c36b60>
255
256 def next(self):
257 self.con._check_closed()
258 self.con._check_thread()
259 if self.exhausted:
260 raise StopIteration
261 item = self.item
262
263 ret = sqlite.sqlite3_step(self.statement)
264 if ret == SQLITE_DONE:
265 self.exhausted = True
266 self.item = None
267 elif ret != SQLITE_ROW:
268 exc = self.con._get_exception(ret)
269 sqlite.sqlite3_reset(self.statement)
270 raise exc
271
272 > self._readahead()
273
274 /opt/pypy/lib_pypy/_sqlite3.py:1027:
275 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
276
277 self = <_sqlite3.Statement object at 0x0000000016c36b60>
278
279 def _readahead(self):
280 self.column_count = sqlite.sqlite3_column_count(self.statement)
281 row = []
282 for i in xrange(self.column_count):
283 typ = sqlite.sqlite3_column_type(self.statement, i)
284
285 converter = self.row_cast_map[i]
286 if converter is None:
287 if typ == SQLITE_INTEGER:
288 val = sqlite.sqlite3_column_int64(self.statement, i)
289 if -sys.maxint-1 <= val <= sys.maxint:
290 val = int(val)
291 elif typ == SQLITE_FLOAT:
292 val = sqlite.sqlite3_column_double(self.statement, i)
293 elif typ == SQLITE_BLOB:
294 blob_len = sqlite.sqlite3_column_bytes(self.statement, i)
295 blob = sqlite.sqlite3_column_blob(self.statement, i)
296 val = buffer(string_at(blob, blob_len))
297 elif typ == SQLITE_NULL:
298 val = None
299 elif typ == SQLITE_TEXT:
300 val = sqlite.sqlite3_column_text(self.statement, i)
301 val = self.con.text_factory(val)
302 else:
303 blob = sqlite.sqlite3_column_blob(self.statement, i)
304 if not blob:
305 val = None
306 else:
307 blob_len = sqlite.sqlite3_column_bytes(self.statement, i)
308 val = string_at(blob, blob_len)
309 val = converter(val)
310 row.append(val)
311
312 row = tuple(row)
313 if self.row_factory is not None:
314 > row = self.row_factory(self.cur(), row)
315
316 /opt/pypy/lib_pypy/_sqlite3.py:1065:
317 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
318
319 self = <_sqlite3.Row object at 0x0000000016c42ad8>, cursor = None
320 values = (u'2',)
321
322 def __init__(self, cursor, values):
323 > self.description = cursor.description
324 E AttributeError: 'NoneType' object has no attribute 'description'
325
326 /opt/pypy/lib_pypy/_sqlite3.py:1091: AttributeError
327 _________________________ test_iter[sqlite/FileStore] __________________________
328
329 store = <MoinMoin.storage.stores.wrappers.ByteToStreamWrappingStore object at 0x00000000170804b8>
330
331 def test_iter(store):
332 kvs = set([('1', 'one'), ('2', 'two'), ('3', 'three'), ])
333 for k, v in kvs:
334 store[k] = v
335 result = set()
336 > for k in store:
337
338 MoinMoin/storage/stores/_tests/test_all.py:42:
339 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
340
341 self = <MoinMoin.storage.stores.sqlite.FileStore object at 0x00000000170e3e50>
342
343 def __iter__(self):
344 > for row in self.conn.execute("select key from {0}".format(self.table_name)):
345
346 MoinMoin/storage/stores/sqlite.py:77:
347 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
348
349 self = <_sqlite3.Statement object at 0x000000001682a0b0>
350
351 def next(self):
352 self.con._check_closed()
353 self.con._check_thread()
354 if self.exhausted:
355 raise StopIteration
356 item = self.item
357
358 ret = sqlite.sqlite3_step(self.statement)
359 if ret == SQLITE_DONE:
360 self.exhausted = True
361 self.item = None
362 elif ret != SQLITE_ROW:
363 exc = self.con._get_exception(ret)
364 sqlite.sqlite3_reset(self.statement)
365 raise exc
366
367 > self._readahead()
368
369 /opt/pypy/lib_pypy/_sqlite3.py:1027:
370 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
371
372 self = <_sqlite3.Statement object at 0x000000001682a0b0>
373
374 def _readahead(self):
375 self.column_count = sqlite.sqlite3_column_count(self.statement)
376 row = []
377 for i in xrange(self.column_count):
378 typ = sqlite.sqlite3_column_type(self.statement, i)
379
380 converter = self.row_cast_map[i]
381 if converter is None:
382 if typ == SQLITE_INTEGER:
383 val = sqlite.sqlite3_column_int64(self.statement, i)
384 if -sys.maxint-1 <= val <= sys.maxint:
385 val = int(val)
386 elif typ == SQLITE_FLOAT:
387 val = sqlite.sqlite3_column_double(self.statement, i)
388 elif typ == SQLITE_BLOB:
389 blob_len = sqlite.sqlite3_column_bytes(self.statement, i)
390 blob = sqlite.sqlite3_column_blob(self.statement, i)
391 val = buffer(string_at(blob, blob_len))
392 elif typ == SQLITE_NULL:
393 val = None
394 elif typ == SQLITE_TEXT:
395 val = sqlite.sqlite3_column_text(self.statement, i)
396 val = self.con.text_factory(val)
397 else:
398 blob = sqlite.sqlite3_column_blob(self.statement, i)
399 if not blob:
400 val = None
401 else:
402 blob_len = sqlite.sqlite3_column_bytes(self.statement, i)
403 val = string_at(blob, blob_len)
404 val = converter(val)
405 row.append(val)
406
407 row = tuple(row)
408 if self.row_factory is not None:
409 > row = self.row_factory(self.cur(), row)
410
411 /opt/pypy/lib_pypy/_sqlite3.py:1065:
412 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
413
414 self = <_sqlite3.Row object at 0x000000000dbe4a68>, cursor = None
415 values = (u'2',)
416
417 def __init__(self, cursor, values):
418 > self.description = cursor.description
419 E AttributeError: 'NoneType' object has no attribute 'description'
420
421 /opt/pypy/lib_pypy/_sqlite3.py:1091: AttributeError
422 ___________________ test_iter[sqlite:compressed/BytesStore] ____________________
423
424 store = <MoinMoin.storage.stores.sqlite.BytesStore object at 0x00000000168e7a60>
425
426 def test_iter(store):
427 kvs = set([('1', 'one'), ('2', 'two'), ('3', 'three'), ])
428 for k, v in kvs:
429 store[k] = v
430 result = set()
431 > for k in store:
432
433 MoinMoin/storage/stores/_tests/test_all.py:42:
434 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
435
436 self = <MoinMoin.storage.stores.sqlite.BytesStore object at 0x00000000168e7a60>
437
438 def __iter__(self):
439 > for row in self.conn.execute("select key from {0}".format(self.table_name)):
440
441 MoinMoin/storage/stores/sqlite.py:77:
442 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
443
444 self = <_sqlite3.Statement object at 0x0000000013bea5c0>
445
446 def next(self):
447 self.con._check_closed()
448 self.con._check_thread()
449 if self.exhausted:
450 raise StopIteration
451 item = self.item
452
453 ret = sqlite.sqlite3_step(self.statement)
454 if ret == SQLITE_DONE:
455 self.exhausted = True
456 self.item = None
457 elif ret != SQLITE_ROW:
458 exc = self.con._get_exception(ret)
459 sqlite.sqlite3_reset(self.statement)
460 raise exc
461
462 > self._readahead()
463
464 /opt/pypy/lib_pypy/_sqlite3.py:1027:
465 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
466
467 self = <_sqlite3.Statement object at 0x0000000013bea5c0>
468
469 def _readahead(self):
470 self.column_count = sqlite.sqlite3_column_count(self.statement)
471 row = []
472 for i in xrange(self.column_count):
473 typ = sqlite.sqlite3_column_type(self.statement, i)
474
475 converter = self.row_cast_map[i]
476 if converter is None:
477 if typ == SQLITE_INTEGER:
478 val = sqlite.sqlite3_column_int64(self.statement, i)
479 if -sys.maxint-1 <= val <= sys.maxint:
480 val = int(val)
481 elif typ == SQLITE_FLOAT:
482 val = sqlite.sqlite3_column_double(self.statement, i)
483 elif typ == SQLITE_BLOB:
484 blob_len = sqlite.sqlite3_column_bytes(self.statement, i)
485 blob = sqlite.sqlite3_column_blob(self.statement, i)
486 val = buffer(string_at(blob, blob_len))
487 elif typ == SQLITE_NULL:
488 val = None
489 elif typ == SQLITE_TEXT:
490 val = sqlite.sqlite3_column_text(self.statement, i)
491 val = self.con.text_factory(val)
492 else:
493 blob = sqlite.sqlite3_column_blob(self.statement, i)
494 if not blob:
495 val = None
496 else:
497 blob_len = sqlite.sqlite3_column_bytes(self.statement, i)
498 val = string_at(blob, blob_len)
499 val = converter(val)
500 row.append(val)
501
502 row = tuple(row)
503 if self.row_factory is not None:
504 > row = self.row_factory(self.cur(), row)
505
506 /opt/pypy/lib_pypy/_sqlite3.py:1065:
507 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
508
509 self = <_sqlite3.Row object at 0x00000000162076a8>, cursor = None
510 values = (u'2',)
511
512 def __init__(self, cursor, values):
513 > self.description = cursor.description
514 E AttributeError: 'NoneType' object has no attribute 'description'
515
516 /opt/pypy/lib_pypy/_sqlite3.py:1091: AttributeError
517 ____________________ test_iter[sqlite:compressed/FileStore] ____________________
518
519 store = <MoinMoin.storage.stores.wrappers.ByteToStreamWrappingStore object at 0x00000000103b2020>
520
521 def test_iter(store):
522 kvs = set([('1', 'one'), ('2', 'two'), ('3', 'three'), ])
523 for k, v in kvs:
524 store[k] = v
525 result = set()
526 > for k in store:
527
528 MoinMoin/storage/stores/_tests/test_all.py:42:
529 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
530
531 self = <MoinMoin.storage.stores.sqlite.FileStore object at 0x00000000103b2058>
532
533 def __iter__(self):
534 > for row in self.conn.execute("select key from {0}".format(self.table_name)):
535
536 MoinMoin/storage/stores/sqlite.py:77:
537 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
538
539 self = <_sqlite3.Statement object at 0x000000000bb800f8>
540
541 def next(self):
542 self.con._check_closed()
543 self.con._check_thread()
544 if self.exhausted:
545 raise StopIteration
546 item = self.item
547
548 ret = sqlite.sqlite3_step(self.statement)
549 if ret == SQLITE_DONE:
550 self.exhausted = True
551 self.item = None
552 elif ret != SQLITE_ROW:
553 exc = self.con._get_exception(ret)
554 sqlite.sqlite3_reset(self.statement)
555 raise exc
556
557 > self._readahead()
558
559 /opt/pypy/lib_pypy/_sqlite3.py:1027:
560 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
561
562 self = <_sqlite3.Statement object at 0x000000000bb800f8>
563
564 def _readahead(self):
565 self.column_count = sqlite.sqlite3_column_count(self.statement)
566 row = []
567 for i in xrange(self.column_count):
568 typ = sqlite.sqlite3_column_type(self.statement, i)
569
570 converter = self.row_cast_map[i]
571 if converter is None:
572 if typ == SQLITE_INTEGER:
573 val = sqlite.sqlite3_column_int64(self.statement, i)
574 if -sys.maxint-1 <= val <= sys.maxint:
575 val = int(val)
576 elif typ == SQLITE_FLOAT:
577 val = sqlite.sqlite3_column_double(self.statement, i)
578 elif typ == SQLITE_BLOB:
579 blob_len = sqlite.sqlite3_column_bytes(self.statement, i)
580 blob = sqlite.sqlite3_column_blob(self.statement, i)
581 val = buffer(string_at(blob, blob_len))
582 elif typ == SQLITE_NULL:
583 val = None
584 elif typ == SQLITE_TEXT:
585 val = sqlite.sqlite3_column_text(self.statement, i)
586 val = self.con.text_factory(val)
587 else:
588 blob = sqlite.sqlite3_column_blob(self.statement, i)
589 if not blob:
590 val = None
591 else:
592 blob_len = sqlite.sqlite3_column_bytes(self.statement, i)
593 val = string_at(blob, blob_len)
594 val = converter(val)
595 row.append(val)
596
597 row = tuple(row)
598 if self.row_factory is not None:
599 > row = self.row_factory(self.cur(), row)
600
601 /opt/pypy/lib_pypy/_sqlite3.py:1065:
602 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
603
604 self = <_sqlite3.Row object at 0x00000000109ac528>, cursor = None
605 values = (u'2',)
606
607 def __init__(self, cursor, values):
608 > self.description = cursor.description
609 E AttributeError: 'NoneType' object has no attribute 'description'
610
611 /opt/pypy/lib_pypy/_sqlite3.py:1091: AttributeError
612 ______________________ TestExtensionInvoking.testFailing _______________________
613
614 self = <test_paramparser.TestExtensionInvoking object at 0x00000000189c2fa8>
615
616 def testFailing(self):
617 ief = paramparser.invoke_extension_function
618
619 pytest.raises(TypeError, ief, hex, u'15')
620 pytest.raises(TypeError, ief, cmp, u'15')
621 > pytest.raises(AttributeError, ief, unicode, u'15')
622
623 MoinMoin/util/_tests/test_paramparser.py:669:
624 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
625
626 function = <type 'unicode'>, args = u'15', fixed_args = []
627
628 def invoke_extension_function(function, args, fixed_args=[]):
629 """
630 Parses arguments for an extension call and calls the extension
631 function with the arguments.
632
633 If the macro function has a default value that is a bool,
634 int, long, float or unicode object, then the given value
635 is converted to the type of that default value before passing
636 it to the macro function. That way, macros need not call the
637 wikiutil.get_* functions for any arguments that have a default.
638
639 :param function: the function to invoke
640 :param args: unicode string with arguments (or evaluating to False)
641 :param fixed_args: fixed arguments to pass as the first arguments
642 :returns: the return value from the function called
643 """
644 from inspect import getargspec, isfunction, isclass, ismethod
645
646 def _convert_arg(value, default, name=None):
647 """
648 Using the get_* functions, convert argument to the type of the default
649 if that is any of bool, int, long, float or unicode; if the default
650 is the type itself then convert to that type (keeps None) or if the
651 default is a list require one of the list items.
652
653 In other cases return the value itself.
654 """
655 # if extending this, extend required_arg as well!
656 if isinstance(default, bool):
657 return get_bool(value, name, default)
658 elif isinstance(default, (int, long)):
659 return get_int(value, name, default)
660 elif isinstance(default, float):
661 return get_float(value, name, default)
662 elif isinstance(default, complex):
663 return get_complex(value, name, default)
664 elif isinstance(default, unicode):
665 return get_unicode(value, name, default)
666 elif isinstance(default, (tuple, list)):
667 return get_choice(value, name, default)
668 elif default is bool:
669 return get_bool(value, name)
670 elif default is int or default is long:
671 return get_int(value, name)
672 elif default is float:
673 return get_float(value, name)
674 elif default is complex:
675 return get_complex(value, name)
676 elif isinstance(default, IEFArgument):
677 # defaults handled later
678 if value is None:
679 return None
680 return default.parse_argument(value)
681 elif isinstance(default, required_arg):
682 if isinstance(default.argtype, (tuple, list)):
683 # treat choice specially and return None if no choice
684 # is given in the value
685 return get_choice(value, name, list(default.argtype),
686 default_none=True)
687 else:
688 return _convert_arg(value, default.argtype, name)
689 return value
690
691 assert isinstance(fixed_args, (list, tuple))
692
693 kwargs = {}
694 kwargs_to_pass = {}
695 trailing_args = []
696
697 if args:
698 assert isinstance(args, unicode)
699
700 positional, keyword, trailing = parse_quoted_separated(args)
701
702 for kw in keyword:
703 try:
704 kwargs[str(kw)] = keyword[kw]
705 except UnicodeEncodeError:
706 kwargs_to_pass[kw] = keyword[kw]
707
708 trailing_args.extend(trailing)
709
710 else:
711 positional = []
712
713 if isfunction(function) or ismethod(function):
714 argnames, varargs, varkw, defaultlist = getargspec(function)
715 elif isclass(function):
716 (argnames, varargs,
717 varkw, defaultlist) = getargspec(function.__init__.im_func)
718 else:
719 raise TypeError('function must be a function, method or class')
720
721 # self is implicit!
722 if ismethod(function) or isclass(function):
723 argnames = argnames[1:]
724
725 fixed_argc = len(fixed_args)
726 argnames = argnames[fixed_argc:]
727 argc = len(argnames)
728 if not defaultlist:
729 defaultlist = []
730
731 # if the fixed parameters have defaults too...
732 if argc < len(defaultlist):
733 defaultlist = defaultlist[fixed_argc:]
734 defstart = argc - len(defaultlist)
735
736 defaults = {}
737 # reverse to be able to pop() things off
738 positional.reverse()
739 allow_kwargs = False
740 allow_trailing = False
741 # convert all arguments to keyword arguments,
742 # fill all arguments that weren't given with None
743 for idx in range(argc):
744 argname = argnames[idx]
745 if argname == '_kwargs':
746 allow_kwargs = True
747 continue
748 if argname == '_trailing_args':
749 allow_trailing = True
750 continue
751 if positional:
752 kwargs[argname] = positional.pop()
753 if not argname in kwargs:
754 kwargs[argname] = None
755 if idx >= defstart:
756 defaults[argname] = defaultlist[idx - defstart]
757
758 if positional:
759 if not allow_trailing:
760 > raise ValueError(_('Too many arguments'))
761 E ValueError: Too many arguments
762
763 MoinMoin/util/paramparser.py:690: ValueError
764 ========= 9 failed, 850 passed, 61 skipped, 1 error in 126.43 seconds ==========
765
766 real 2m7.532s
767 user 1m49.173s
768 sys 0m2.093s
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.