[MIR] python-fixtures, needed as a b-d for python-testtools

Bug #692955 reported by Matthias Klose
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-fixtures (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: python-fixtures

python-fixtures, needed as a b-d for python-testtools, small python library maintained by the same author as python-testtools. Either bug-free or not much used. Looks ok for promotion.

Tags: python27
Michael Terry (mterry)
Changed in python-fixtures (Ubuntu):
assignee: nobody → Michael Terry (mterry)
status: New → In Progress
Revision history for this message
Michael Terry (mterry) wrote :

The package itself looks clean. It would be nice if someone subscribed to bugmail.

But I can't approve, because the package FTBFS. It's unit tests fail on calls to assertIsInstance.

Changed in python-fixtures (Ubuntu):
assignee: Michael Terry (mterry) → nobody
status: In Progress → Incomplete
Revision history for this message
Matthias Klose (doko) wrote :

oops, I did hit the commit button too fast ...

2010-12-21 19:01:25 INFO Override Component to: 'main'
2010-12-21 19:01:35 INFO 'python-fixtures - 0.3.5-1/universe/python' source overridden
2010-12-21 19:01:35 INFO 'python-fixtures-0.3.5-1/universe/python/OPTIONAL' binary overridden in natty/amd64
2010-12-21 19:01:35 INFO 'python-fixtures-0.3.5-1/universe/python/OPTIONAL' binary overridden in natty/armel
2010-12-21 19:01:35 INFO 'python-fixtures-0.3.5-1/universe/python/OPTIONAL' binary overridden in natty/i386
2010-12-21 19:01:35 INFO 'python-fixtures-0.3.5-1/universe/python/OPTIONAL' binary overridden in natty/powerpc

the tests fail with python2.7 only:

Tests running...
======================================================================
ERROR: fixtures.tests.test_fixture.TestFixture.test_addDetail
----------------------------------------------------------------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 144, in _run_user
    return fn(*args)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 425, in _run_test_method
    testMethod()
  File "/scratch/packages/tmp/python-fixtures-0.3.5/lib/fixtures/tests/test_fixture.py", line 12
2, in test_addDetail
    self.assertEqual({'foo': 'content'}, fixture.getDetails())
  File "/usr/lib/python2.7/unittest/case.py", line 494, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 807, in assertDictEqual
    self.assertIsInstance(d1, dict, 'First argument is not a dictionary')
TypeError: assertIsInstance() takes exactly 3 arguments (4 given)
------------
======================================================================
ERROR: fixtures.tests.test_fixture.TestFixture.test_getDetails
----------------------------------------------------------------------
Text attachment: traceback

tags: added: python27
Revision history for this message
Robert Collins (lifeless) wrote :

This is a bug in testtools - pull a newer testtools from debian.

Revision history for this message
Robert Collins (lifeless) wrote :

(the FTBFS that is)

Revision history for this message
Michael Terry (mterry) wrote :

Hrm... We have pulled latest 0.9.8-1 from Debian. But it's Build-Dep blocked on python-fixtures. :)

I tested with the latest python-testtools from Debian and I still got the following failure (though I didn't get all the assertIsInstance errors):

======================================================================
FAIL: fixtures.tests.test_fixture.TestFixture.test_cleanUp_raise_first_false_callscleanups_returns_exceptions
----------------------------------------------------------------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 169, in _run_user
    return fn(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 499, in _run_test_method
    return self._get_test_method()()
  File "/home/mike/Projects/natty/python-fixtures-0.3.5/lib/fixtures/tests/test_fixture.py", line 76, in test_cleanUp_raise_first_false_callscleanups_returns_exceptions
    self.assertIsInstance(tb, sys.exc_info()[2].__class__)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 307, in assertIsInstance
    self.assertTrue(isinstance(obj, klass), msg)
AssertionError: <traceback object at 0x1474488> is not an instance of NoneType

Revision history for this message
Loïc Minier (lool) wrote :

I can confirm that with the latest testtools in my PYTHONPATH, I still get weird test failures; they seem to be a python bug

This is a reduced test case:

import testtools

class Fixture(object):
    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        return False # propogate exceptions from the with body.

class TestFixture(testtools.TestCase):
    def test_addDetail(self):
        fixture = Fixture()
        with fixture:
            self.assertEqual({'foo': 'content'}, {'foo': 'content'})

save as fixture.py and run with python -m testtools.run fixture.TestFixture.test_addDetail

if you change return False to return True, it passes

Revision history for this message
Loïc Minier (lool) wrote :

Hmm, probably not a bug in python since swapping testtools with unittest works

I've filed bug #693167 to track this issue

Revision history for this message
Loïc Minier (lool) wrote :

Sorry, I was setting my PYTHONPATH to the wrong subdir; it works with latest python-testtools!

Revision history for this message
Michael Terry (mterry) wrote :

Loïc, are you saying that you can build python-fixtures and all tests pass? I'm still not seeing that, even with the python-testtools from Ubuntu (it built now that this package was pre-promoted to main).

Revision history for this message
Matthias Klose (doko) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

@Michael: no, just my test case passed with the new testtools, was trying the -fixtures with it and it indeed still fails with it

Revision history for this message
Loïc Minier (lool) wrote :

I've uploaded a fixed python-fixtures and sent the patch upstream in bug #693188

Revision history for this message
Michael Terry (mterry) wrote :

OK, now that it passes its tests, approved. Note that there are still some nits:

W: python-fixtures source: build-depends-on-python-dev-with-no-arch-any
W: python-fixtures: copyright-refers-to-deprecated-bsd-license-file

And no Ubuntu bug subscriber.

Changed in python-fixtures (Ubuntu):
status: Incomplete → Fix Committed
Revision history for this message
Michael Terry (mterry) wrote :

Oh, fix released because it was pre-promoted.

Changed in python-fixtures (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.