test_hash_missing_required_attrs failing

Bug #825249 reported by Paul Howarth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zope.interface
Fix Released
Undecided
Tres Seaver

Bug Description

When running the whole test suite via "python setup.py test", the newly-added (in 3.6.5) test_hash_missing_required_attrs test fails:

======================================================================
FAIL: test_hash_missing_required_attrs (zope.interface.tests.test_interface.InterfaceTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/zope.interface-3.6.5/src/zope/interface/tests/test_interface.py", line 420, in test_hash_missing_required_attrs
    self.assertEqual(len(warned), 1)
AssertionError: 0 != 1
----------------------------------------------------------------------
Ran 167 tests in 0.209s
FAILED (failures=1)

Attached patch fixes the problem for me by ensuring that no warnings are filtered.

Revision history for this message
Paul Howarth (paul-nat) wrote :
Revision history for this message
Tres Seaver (tseaver) wrote :

Thanks for the catch: the tests all passed when run under the buildout's
'test' command.

I will apply your fix, moving the 'setfilters' call inside the
'with catch_warnings' statement, so that any previous settings get
restored.

Changed in zope.interface:
status: New → Confirmed
Revision history for this message
Tres Seaver (tseaver) wrote :
Changed in zope.interface:
assignee: nobody → Tres Seaver (tseaver)
status: Confirmed → Fix Committed
Revision history for this message
Paul Howarth (paul-nat) wrote :

Thanks; just one additional point: the use of "with" in this test breaks the test suite for python 2.4 (it passes otherwise). I guess that's not a big deal as nobody using the latest release is likely to be using python 2.4 now.

Tres Seaver (tseaver)
Changed in zope.interface:
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.