/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Robert Collins
  • Date: 2007-11-05 19:40:28 UTC
  • mfrom: (2963 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2967.
  • Revision ID: robertc@robertcollins.net-20071105194028-5gc6rdajk96maaq1
Merge bzr.dev.

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