Commits

Ezio Melotti committed e1caed6

Replace deprecated fail* methods with the equivalent assert* ones.

Comments (0)

Files changed (1)

Lib/test/test_shutil.py

         self._set_shutil_open(_open)
 
         shutil.copyfile('srcfile', 'destfile')
-        self.failUnless(srcfile._entered)
-        self.failUnless(srcfile._exited_with[0] is IOError)
+        self.assertTrue(srcfile._entered)
+        self.assertTrue(srcfile._exited_with[0] is IOError)
         self.assertEqual(srcfile._exited_with[1].args,
                          ('Cannot open "destfile"',))
 
         self._set_shutil_open(_open)
 
         shutil.copyfile('srcfile', 'destfile')
-        self.failUnless(srcfile._entered)
-        self.failUnless(destfile._entered)
-        self.failUnless(destfile._raised)
-        self.failUnless(srcfile._exited_with[0] is IOError)
+        self.assertTrue(srcfile._entered)
+        self.assertTrue(destfile._entered)
+        self.assertTrue(destfile._raised)
+        self.assertTrue(srcfile._exited_with[0] is IOError)
         self.assertEqual(srcfile._exited_with[1].args,
                          ('Cannot close',))
 
 
         self.assertRaises(IOError,
                           shutil.copyfile, 'srcfile', 'destfile')
-        self.failUnless(srcfile._entered)
-        self.failUnless(destfile._entered)
-        self.failIf(destfile._raised)
-        self.failUnless(srcfile._exited_with[0] is None)
-        self.failUnless(srcfile._raised)
+        self.assertTrue(srcfile._entered)
+        self.assertTrue(destfile._entered)
+        self.assertFalse(destfile._raised)
+        self.assertTrue(srcfile._exited_with[0] is None)
+        self.assertTrue(srcfile._raised)
 
 
 def test_main():