Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed82ca1

Browse files
committed
Ditch some dead code in test_unicode_file.
Closes issue #10294. Thanks Stefan Behnel for the find.
1 parent 7a26cb9 commit ed82ca1

2 files changed

Lines changed: 2 additions & 26 deletions

File tree

Lib/test/test_unicode_file.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,6 @@ def _do_single(self, filename):
5151

5252
self.assertIn(base, file_list)
5353

54-
# Do as many "equivalancy' tests as we can - ie, check that although we
55-
# have different types for the filename, they refer to the same file.
56-
def _do_equivalent(self, filename1, filename2):
57-
# Note we only check "filename1 against filename2" - we don't bother
58-
# checking "filename2 against 1", as we assume we are called again with
59-
# the args reversed.
60-
self.assertTrue(type(filename1)!=type(filename2),
61-
"No point checking equivalent filenames of the same type")
62-
# stat and lstat should return the same results.
63-
self.assertEqual(os.stat(filename1),
64-
os.stat(filename2))
65-
self.assertEqual(os.lstat(filename1),
66-
os.lstat(filename2))
67-
# Copy/rename etc tests using equivalent filename
68-
self._do_copyish(filename1, filename2)
69-
7054
# Tests that copy, move, etc one file to another.
7155
def _do_copyish(self, filename1, filename2):
7256
# Should be able to rename the file using either name.
@@ -130,16 +114,6 @@ def _test_single(self, filename):
130114
finally:
131115
os.unlink(filename)
132116

133-
def _test_equivalent(self, filename1, filename2):
134-
remove_if_exists(filename1)
135-
self.assertTrue(not os.path.exists(filename2))
136-
f = file(filename1, "w")
137-
f.close()
138-
try:
139-
self._do_equivalent(filename1, filename2)
140-
finally:
141-
os.unlink(filename1)
142-
143117
# The 'test' functions are unittest entry points, and simply call our
144118
# _test functions with each of the filename combinations we wish to test
145119
def test_single_files(self):

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ Tools/Demos
243243
Tests
244244
-----
245245

246+
- Issue #10294: Remove dead code form test_unicode_file.
247+
246248
- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a
247249
new test specific to unicode (non-ascii name and filename).
248250

0 commit comments

Comments
 (0)