← Back to team overview

dulwich-users team mailing list archive

Re: Test runners, nose and python 2.7

 

On Mon, Dec 27, 2010 at 18:03, Dave Borowitz <dborowitz@xxxxxxxxxx> wrote:

> On Sun, Dec 26, 2010 at 18:04, Jelmer Vernooij <jelmer@xxxxxxxxx> wrote:
>
>> On Mon, Dec 27, 2010 at 02:46:51AM +0100, Jelmer Vernooij wrote:
>> > On Sun, Dec 26, 2010 at 04:23:54PM -0500, Augie Fackler wrote:
>> > > >> We can codify that in setup.py and make
>> > > >> it the One True Test System (and depending on unittest2 for old
>> > > >> Pythons means that we can continue using the normal SkipTest
>> > > >> approach *and* dispense with the madness in test/__init__ that
>> tries
>> > > >> to get the "right" SkipTest. I'm happy to take on this work if
>> > > >> nobody objects.
>> > > > I can live with unittest2 as default fallback test runner but
>> > > > would like to keep the support for using testtools without the need
>> to
>> > > > install unittest2. What do you think about the attached patch?
>> > > Should probably also list unittest2 in the test_requires stanza of the
>> > > setup() call in setup.py if sys.version < (2,7).
>> > That's a good point.
>> I've pushed the switch to unittest + unittest2 but without the
>> test_requires stanza.
>> Not having it doesn't seem to break anything (we never had it for nose)
>> and I can't
>> work out what to set exactly. Patches to add it welcome.
>
>
> I haven't been following this discussion closely, but what you just pushed
> fails on 2.6 even after installing (with pip) unittest2 and testtools (trace
> below).
>
> I don't really care what the ultimate answer is, but I'd appreciate it if
> you could run any more potential fixes by me so I can try the tests against
> master with my setup.
>

Oh, and if I use nosetests manually, testtools is failing with a bunch of
errors like the following. IIRC I mailed a change that fixes these, too.

======================================================================
ERROR:
dulwich.tests.test_repository.CreateRepositoryTests.test_create_memory
----------------------------------------------------------------------
_StringException: Text attachment: traceback
------------
Traceback (most recent call last):
  File
"/home/dborowitz/.virtualenvs/dulwich/lib/python2.6/site-packages/testtools/runtest.py",
line 169, in _run_user
    return fn(*args, **kwargs)
  File
"/home/dborowitz/.virtualenvs/dulwich/lib/python2.6/site-packages/testtools/testcase.py",
line 465, in _run_setup
    % self.__class__.__name__)
ValueError: TestCase.setUp was not called. Have you upcalled all the way up
the hierarchy from your setUp? e.g. Call super(CreateRepositoryTests,
self).setUp() from your setUp().
------------


> git checkout origin/master && git clean -f -x -d && make check
> HEAD is now at 79f0b96... Use unittest or unittest2 test runner instead of
> nose for running tests from the testsuite.
> Removing build/
> Removing dulwich/_diff_tree.so
> Removing dulwich/_objects.so
> Removing dulwich/_pack.so
> python setup.py build
> running build
> running build_py
>  creating build
> creating build/lib.linux-x86_64-2.6
> creating build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/server.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/pack.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/object_store.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/index.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/client.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/protocol.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/errors.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/fastexport.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/patch.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/__init__.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/log_utils.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/web.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/file.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/repo.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/objects.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/_compat.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/diff_tree.py -> build/lib.linux-x86_64-2.6/dulwich
> copying dulwich/lru_cache.py -> build/lib.linux-x86_64-2.6/dulwich
> creating build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_protocol.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_object_store.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_repository.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_client.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_patch.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_index.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_file.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_fastexport.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_web.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_objects.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_pack.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_blackbox.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/__init__.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/utils.py -> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_lru_cache.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_diff_tree.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> copying dulwich/tests/test_server.py ->
> build/lib.linux-x86_64-2.6/dulwich/tests
> running build_ext
> building 'dulwich._objects' extension
> creating build/temp.linux-x86_64-2.6
> creating build/temp.linux-x86_64-2.6/dulwich
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c dulwich/_objects.c -o
> build/temp.linux-x86_64-2.6/dulwich/_objects.o
> gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
> build/temp.linux-x86_64-2.6/dulwich/_objects.o -o
> build/lib.linux-x86_64-2.6/dulwich/_objects.so
> building 'dulwich._pack' extension
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c dulwich/_pack.c -o
> build/temp.linux-x86_64-2.6/dulwich/_pack.o
> gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
> build/temp.linux-x86_64-2.6/dulwich/_pack.o -o
> build/lib.linux-x86_64-2.6/dulwich/_pack.so
> building 'dulwich._diff_tree' extension
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c dulwich/_diff_tree.c
> -o build/temp.linux-x86_64-2.6/dulwich/_diff_tree.o
> gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
> build/temp.linux-x86_64-2.6/dulwich/_diff_tree.o -o
> build/lib.linux-x86_64-2.6/dulwich/_diff_tree.so
> running build_scripts
> creating build/scripts-2.6
> copying and adjusting bin/dulwich -> build/scripts-2.6
> copying and adjusting bin/dul-daemon -> build/scripts-2.6
> copying and adjusting bin/dul-web -> build/scripts-2.6
> changing mode of build/scripts-2.6/dulwich from 640 to 755
> changing mode of build/scripts-2.6/dul-daemon from 640 to 755
> changing mode of build/scripts-2.6/dul-web from 640 to 755
> python setup.py build_ext -i
> running build_ext
> copying build/lib.linux-x86_64-2.6/dulwich/_objects.so -> dulwich
> copying build/lib.linux-x86_64-2.6/dulwich/_pack.so -> dulwich
> copying build/lib.linux-x86_64-2.6/dulwich/_diff_tree.so -> dulwich
> PYTHONPATH=. python -m unittest2 dulwich.tests.test_suite
> /home/dborowitz/.virtualenvs/dulwich/bin/python: unittest2 is a package and
> cannot be directly executed
> make: *** [check] Error 1
>
>
>
>>  Cheers,
>>
>> Jelmer
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dulwich-users
>> Post to     : dulwich-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dulwich-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>
>

Follow ups

References