~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-26 08:56:09 UTC
  • mfrom: (2592.3.247 mbp-writegroups)
  • Revision ID: pqm@pqm.ubuntu.com-20071026085609-c3r8skfrmjj21j0m
Unlock while in a write group now aborts the write group, unlocks, and errors.  Also includes the knit extraction one-liner tweak.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1525
1525
        self.callDeprecated([], testfunc, be_deprecated=False)
1526
1526
 
1527
1527
 
 
1528
class TestWarningTests(TestCase):
 
1529
    """Tests for calling methods that raise warnings."""
 
1530
 
 
1531
    def test_callCatchWarnings(self):
 
1532
        def meth(a, b):
 
1533
            warnings.warn("this is your last warning")
 
1534
            return a + b
 
1535
        wlist, result = self.callCatchWarnings(meth, 1, 2)
 
1536
        self.assertEquals(3, result)
 
1537
        # would like just to compare them, but UserWarning doesn't implement
 
1538
        # eq well
 
1539
        w0, = wlist
 
1540
        self.assertIsInstance(w0, UserWarning)
 
1541
        self.assertEquals("this is your last warning", str(w0))
 
1542
 
 
1543
 
1528
1544
class TestConvenienceMakers(TestCaseWithTransport):
1529
1545
    """Test for the make_* convenience functions."""
1530
1546