diff --git a/Lib/test/test_filecmp.py b/Lib/test/test_filecmp.py index b433ecc9ef1..c54119c2979 100644 --- a/Lib/test/test_filecmp.py +++ b/Lib/test/test_filecmp.py @@ -46,10 +46,11 @@ def setUp(self): self.dir = os.path.join(tmpdir, 'dir') self.dir_same = os.path.join(tmpdir, 'dir-same') self.dir_diff = os.path.join(tmpdir, 'dir-diff') + self.caseinsensitive = os.path.normcase('A') == os.path.normcase('a') data = 'Contents of file go here.\n' for dir in [self.dir, self.dir_same, self.dir_diff]: os.mkdir(dir) - if dir is self.dir_same: + if self.caseinsensitive and dir is self.dir_same: fn = 'FiLe' # Verify case-insensitive comparison else: fn = 'file' @@ -97,7 +98,10 @@ def test_cmpfiles(self): def test_dircmp(self): # Check attributes for comparison of two identical directories d = filecmp.dircmp(self.dir, self.dir_same) - self.assertEqual([d.left_list, d.right_list],[['file'], ['FiLe']]) + if self.caseinsensitive: + self.assertEqual([d.left_list, d.right_list],[['file'], ['FiLe']]) + else: + self.assertEqual([d.left_list, d.right_list],[['file'], ['file']]) self.failUnless(d.common == ['file']) self.failUnless(d.left_only == d.right_only == []) self.failUnless(d.same_files == ['file'])