
Installing MediaGoblin with Python 2.6
======================================

$ python --version
Python 2.6.6

[... git clone, cd mediagoblin, git submodule, virtualenv ...]

$ ./bin/python --version
Python 2.6.6

$ ./bin/python setup.py develop
[...]
Finished processing dependencies for mediagoblin==0.6.2.dev
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib/python2.6/multiprocessing/util.py", line 258, in _exit_function
    info('process shutting down')
TypeError: 'NoneType' object is not callable
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/lib/python2.6/multiprocessing/util.py", line 258, in _exit_function
    info('process shutting down')
TypeError: 'NoneType' object is not callable

$ ./bin/gmg dbupdate
[...]



Running tests
=============


$ ./runtests.sh 
Using ./bin/py.test
+ exec ./bin/py.test ./mediagoblin/tests --boxed
============================= test session starts ==============================
platform linux2 -- Python 2.6.6 -- py-1.4.20 -- pytest-2.5.2
plugins: xdist
collected 130 items / 2 skipped 

mediagoblin/tests/test_api.py ..
mediagoblin/tests/test_auth.py ...
mediagoblin/tests/test_basic_auth.py ...
mediagoblin/tests/test_celery_setup.py .
mediagoblin/tests/test_collections.py .
mediagoblin/tests/test_config.py ..
mediagoblin/tests/test_csrf_middleware.py ...
mediagoblin/tests/test_edit.py ....
mediagoblin/tests/test_exif.py .....
mediagoblin/tests/test_globals.py .
mediagoblin/tests/test_http_callback.py .
mediagoblin/tests/test_messages.py .
mediagoblin/tests/test_metadata.py .
mediagoblin/tests/test_misc.py ...
mediagoblin/tests/test_modelmethods.py ............F
mediagoblin/tests/test_moderation.py ....
mediagoblin/tests/test_notifications.py ...
mediagoblin/tests/test_oauth1.py ....
mediagoblin/tests/test_oauth2.py .......
mediagoblin/tests/test_pdf.py s
mediagoblin/tests/test_persona.py .
mediagoblin/tests/test_piwigo.py .
mediagoblin/tests/test_pluginapi.py ...........
mediagoblin/tests/test_privileges.py ..
mediagoblin/tests/test_processing.py ..
mediagoblin/tests/test_reporting.py ...
mediagoblin/tests/test_session.py .
mediagoblin/tests/test_sql_migrations.py .
mediagoblin/tests/test_staticdirect.py .
mediagoblin/tests/test_storage.py .............
mediagoblin/tests/test_submission.py ...s.............
mediagoblin/tests/test_tags.py .
mediagoblin/tests/test_timesince.py .
mediagoblin/tests/test_util.py .......
mediagoblin/tests/test_workbench.py .....

=================================== FAILURES ===================================
______________ TestUserUrlForSelf.test_url_for_self_not_callable _______________
Traceback (most recent call last):
  File "/home/debian/mediagoblin/2.6/mediagoblin/mediagoblin/tests/test_modelmethods.py", line 229, in test_url_for_self_not_callable
    assert excinfo.errisinstance(TypeError)
AssertionError: assert <bound method ExceptionInfo.errisinstance of <ExceptionInfo TypeError tblen=2>>(TypeError)
 +  where <bound method ExceptionInfo.errisinstance of <ExceptionInfo TypeError tblen=2>> = <ExceptionInfo TypeError tblen=2>.errisinstance
------------------------------- Captured stdout --------------------------------
-> Initializing main mediagoblin tables... done.
   + Laying foundations for Privilege table
-> Initializing plugin "mediagoblin.plugins.oauth"... done.
-> Initializing plugin "mediagoblin.plugins.openid"... done.
-> Initializing plugin "mediagoblin.media_types.image"... done.
-> Initializing plugin "mediagoblin.media_types.pdf"... done.
-> Initializing main mediagoblin tables... done.
   + Laying foundations for Privilege table
-> Initializing plugin "mediagoblin.plugins.oauth"... done.
-> Initializing plugin "mediagoblin.plugins.openid"... done.
-> Initializing plugin "mediagoblin.media_types.image"... done.
-> Initializing plugin "mediagoblin.media_types.pdf"... done.
============== 1 failed, 127 passed, 4 skipped in 567.68 seconds ===============



Problematic code is an assertion in 'test_modelmethods.py' on line 229 : 

 227    with pytest.raises(TypeError) as excinfo:
 228        self.user(u'lindsay').url_for_self(fake_urlgen())
 229    assert excinfo.errisinstance(TypeError)



Experimenting with pytest, ExceptionInfo, and errisinstance
===========================================================

There is a difference in the behavior of errisinstance() 
between python 2.6 and 2.7



 Python 2.6.6                                  | Python 2.7.3
-----------------------------------------------|------------------------------
 >>> import pytest                             | >>> import pytest
 >>> pytest.__version__                        | >>> pytest.__version__
 '2.5.2'                                       | '2.5.2' 
 >>> with pytest.raises(TypeError) as excinfo: | >>> with pytest.raises(TypeError) as excinfo:
 ...     x = len(3)                            | ...     x = len(3)
 ...                                           | ...
 >>> excinfo                                   | >>> excinfo
 <ExceptionInfo TypeError tblen=1>             | <ExceptionInfo TypeError tblen=1>
 >>> excinfo.errisinstance(TypeError)          | >>> excinfo.errisinstance(TypeError) 
 False                                         | True


