Commits

Michael Foord  committed 6c84d1d

Change warning tests to use assertWarns

  • Participants
  • Parent commits 52aa9b1

Comments (0)

Files changed (1)

File unittest2/test/_test_unittest2_with.py

             self._formatMessage(one, u'\uFFFD')
 
     def assertOldResultWarning(self, test, failures):
-        with catch_warnings(record=True) as log:
+        with self.assertWarns(RuntimeWarning):
             result = OldTestResult()
             test.run(result)
             self.assertEqual(len(result.failures), failures)
-            warning, = log
-            self.assertIs(warning.category, RuntimeWarning)
 
     def test_old_testresult(self):
         class Test(unittest2.TestCase):