1 |
|
---|
2 | Installing MediaGoblin with Python 2.6
|
---|
3 | ======================================
|
---|
4 |
|
---|
5 | $ python --version
|
---|
6 | Python 2.6.6
|
---|
7 |
|
---|
8 | [... git clone, cd mediagoblin, git submodule, virtualenv ...]
|
---|
9 |
|
---|
10 | $ ./bin/python --version
|
---|
11 | Python 2.6.6
|
---|
12 |
|
---|
13 | $ ./bin/python setup.py develop
|
---|
14 | [...]
|
---|
15 | Finished processing dependencies for mediagoblin==0.6.2.dev
|
---|
16 | Error in atexit._run_exitfuncs:
|
---|
17 | Traceback (most recent call last):
|
---|
18 | File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
|
---|
19 | func(*targs, **kargs)
|
---|
20 | File "/usr/lib/python2.6/multiprocessing/util.py", line 258, in _exit_function
|
---|
21 | info('process shutting down')
|
---|
22 | TypeError: 'NoneType' object is not callable
|
---|
23 | Error in sys.exitfunc:
|
---|
24 | Traceback (most recent call last):
|
---|
25 | File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
|
---|
26 | func(*targs, **kargs)
|
---|
27 | File "/usr/lib/python2.6/multiprocessing/util.py", line 258, in _exit_function
|
---|
28 | info('process shutting down')
|
---|
29 | TypeError: 'NoneType' object is not callable
|
---|
30 |
|
---|
31 | $ ./bin/gmg dbupdate
|
---|
32 | [...]
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 | Running tests
|
---|
37 | =============
|
---|
38 |
|
---|
39 |
|
---|
40 | $ ./runtests.sh
|
---|
41 | Using ./bin/py.test
|
---|
42 | + exec ./bin/py.test ./mediagoblin/tests --boxed
|
---|
43 | ============================= test session starts ==============================
|
---|
44 | platform linux2 -- Python 2.6.6 -- py-1.4.20 -- pytest-2.5.2
|
---|
45 | plugins: xdist
|
---|
46 | collected 130 items / 2 skipped
|
---|
47 |
|
---|
48 | mediagoblin/tests/test_api.py ..
|
---|
49 | mediagoblin/tests/test_auth.py ...
|
---|
50 | mediagoblin/tests/test_basic_auth.py ...
|
---|
51 | mediagoblin/tests/test_celery_setup.py .
|
---|
52 | mediagoblin/tests/test_collections.py .
|
---|
53 | mediagoblin/tests/test_config.py ..
|
---|
54 | mediagoblin/tests/test_csrf_middleware.py ...
|
---|
55 | mediagoblin/tests/test_edit.py ....
|
---|
56 | mediagoblin/tests/test_exif.py .....
|
---|
57 | mediagoblin/tests/test_globals.py .
|
---|
58 | mediagoblin/tests/test_http_callback.py .
|
---|
59 | mediagoblin/tests/test_messages.py .
|
---|
60 | mediagoblin/tests/test_metadata.py .
|
---|
61 | mediagoblin/tests/test_misc.py ...
|
---|
62 | mediagoblin/tests/test_modelmethods.py ............F
|
---|
63 | mediagoblin/tests/test_moderation.py ....
|
---|
64 | mediagoblin/tests/test_notifications.py ...
|
---|
65 | mediagoblin/tests/test_oauth1.py ....
|
---|
66 | mediagoblin/tests/test_oauth2.py .......
|
---|
67 | mediagoblin/tests/test_pdf.py s
|
---|
68 | mediagoblin/tests/test_persona.py .
|
---|
69 | mediagoblin/tests/test_piwigo.py .
|
---|
70 | mediagoblin/tests/test_pluginapi.py ...........
|
---|
71 | mediagoblin/tests/test_privileges.py ..
|
---|
72 | mediagoblin/tests/test_processing.py ..
|
---|
73 | mediagoblin/tests/test_reporting.py ...
|
---|
74 | mediagoblin/tests/test_session.py .
|
---|
75 | mediagoblin/tests/test_sql_migrations.py .
|
---|
76 | mediagoblin/tests/test_staticdirect.py .
|
---|
77 | mediagoblin/tests/test_storage.py .............
|
---|
78 | mediagoblin/tests/test_submission.py ...s.............
|
---|
79 | mediagoblin/tests/test_tags.py .
|
---|
80 | mediagoblin/tests/test_timesince.py .
|
---|
81 | mediagoblin/tests/test_util.py .......
|
---|
82 | mediagoblin/tests/test_workbench.py .....
|
---|
83 |
|
---|
84 | =================================== FAILURES ===================================
|
---|
85 | ______________ TestUserUrlForSelf.test_url_for_self_not_callable _______________
|
---|
86 | Traceback (most recent call last):
|
---|
87 | File "/home/debian/mediagoblin/2.6/mediagoblin/mediagoblin/tests/test_modelmethods.py", line 229, in test_url_for_self_not_callable
|
---|
88 | assert excinfo.errisinstance(TypeError)
|
---|
89 | AssertionError: assert <bound method ExceptionInfo.errisinstance of <ExceptionInfo TypeError tblen=2>>(TypeError)
|
---|
90 | + where <bound method ExceptionInfo.errisinstance of <ExceptionInfo TypeError tblen=2>> = <ExceptionInfo TypeError tblen=2>.errisinstance
|
---|
91 | ------------------------------- Captured stdout --------------------------------
|
---|
92 | -> Initializing main mediagoblin tables... done.
|
---|
93 | + Laying foundations for Privilege table
|
---|
94 | -> Initializing plugin "mediagoblin.plugins.oauth"... done.
|
---|
95 | -> Initializing plugin "mediagoblin.plugins.openid"... done.
|
---|
96 | -> Initializing plugin "mediagoblin.media_types.image"... done.
|
---|
97 | -> Initializing plugin "mediagoblin.media_types.pdf"... done.
|
---|
98 | -> Initializing main mediagoblin tables... done.
|
---|
99 | + Laying foundations for Privilege table
|
---|
100 | -> Initializing plugin "mediagoblin.plugins.oauth"... done.
|
---|
101 | -> Initializing plugin "mediagoblin.plugins.openid"... done.
|
---|
102 | -> Initializing plugin "mediagoblin.media_types.image"... done.
|
---|
103 | -> Initializing plugin "mediagoblin.media_types.pdf"... done.
|
---|
104 | ============== 1 failed, 127 passed, 4 skipped in 567.68 seconds ===============
|
---|
105 |
|
---|
106 |
|
---|
107 |
|
---|
108 | Problematic code is an assertion in 'test_modelmethods.py' on line 229 :
|
---|
109 |
|
---|
110 | 227 with pytest.raises(TypeError) as excinfo:
|
---|
111 | 228 self.user(u'lindsay').url_for_self(fake_urlgen())
|
---|
112 | 229 assert excinfo.errisinstance(TypeError)
|
---|
113 |
|
---|
114 |
|
---|
115 |
|
---|
116 | Experimenting with pytest, ExceptionInfo, and errisinstance
|
---|
117 | ===========================================================
|
---|
118 |
|
---|
119 | There is a difference in the behavior of errisinstance()
|
---|
120 | between python 2.6 and 2.7
|
---|
121 |
|
---|
122 |
|
---|
123 |
|
---|
124 | Python 2.6.6 | Python 2.7.3
|
---|
125 | -----------------------------------------------|------------------------------
|
---|
126 | >>> import pytest | >>> import pytest
|
---|
127 | >>> pytest.__version__ | >>> pytest.__version__
|
---|
128 | '2.5.2' | '2.5.2'
|
---|
129 | >>> with pytest.raises(TypeError) as excinfo: | >>> with pytest.raises(TypeError) as excinfo:
|
---|
130 | ... x = len(3) | ... x = len(3)
|
---|
131 | ... | ...
|
---|
132 | >>> excinfo | >>> excinfo
|
---|
133 | <ExceptionInfo TypeError tblen=1> | <ExceptionInfo TypeError tblen=1>
|
---|
134 | >>> excinfo.errisinstance(TypeError) | >>> excinfo.errisinstance(TypeError)
|
---|
135 | False | True
|
---|
136 |
|
---|
137 |
|
---|