diff options
author | Hynek Schlawack <hs@ox.cx> | 2012-07-19 21:41:02 +0200 |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2012-07-19 21:41:02 +0200 |
commit | 26fe37dd3f5b994722eb093f95e917282368d7da (patch) | |
tree | 7ec04c2239d15b0769faaea76fea96c2bd05e5e6 /Lib/test | |
parent | 024abca053dd18b474b41eba2331d35b24c3bae3 (diff) | |
download | cpython-git-26fe37dd3f5b994722eb093f95e917282368d7da.tar.gz |
#1492704: Backout and wait for 3.4
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_shutil.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index cbca767a4c..eb0e9a4ee7 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -18,8 +18,7 @@ from shutil import (_make_tarball, _make_zipfile, make_archive, register_archive_format, unregister_archive_format, get_archive_formats, Error, unpack_archive, register_unpack_format, RegistryError, - unregister_unpack_format, get_unpack_formats, - SameFileError) + unregister_unpack_format, get_unpack_formats) import tarfile import warnings @@ -689,7 +688,7 @@ class TestShutil(unittest.TestCase): with open(src, 'w') as f: f.write('cheddar') os.link(src, dst) - self.assertRaises(shutil.SameFileError, shutil.copyfile, src, dst) + self.assertRaises(shutil.Error, shutil.copyfile, src, dst) with open(src, 'r') as f: self.assertEqual(f.read(), 'cheddar') os.remove(dst) @@ -709,7 +708,7 @@ class TestShutil(unittest.TestCase): # to TESTFN/TESTFN/cheese, while it should point at # TESTFN/cheese. os.symlink('cheese', dst) - self.assertRaises(shutil.SameFileError, shutil.copyfile, src, dst) + self.assertRaises(shutil.Error, shutil.copyfile, src, dst) with open(src, 'r') as f: self.assertEqual(f.read(), 'cheddar') os.remove(dst) @@ -1216,14 +1215,6 @@ class TestShutil(unittest.TestCase): self.assertTrue(os.path.exists(rv)) self.assertEqual(read_file(src_file), read_file(dst_file)) - def test_copyfile_same_file(self): - # copyfile() should raise SameFileError if the source and destination - # are the same. - src_dir = self.mkdtemp() - src_file = os.path.join(src_dir, 'foo') - write_file(src_file, 'foo') - self.assertRaises(SameFileError, shutil.copyfile, src_file, src_file) - def test_copytree_return_value(self): # copytree returns its destination path. src_dir = self.mkdtemp() |