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

Skip to content

Commit dc3e06c

Browse files
committed
Have test_coding conditionally remove test files instead of assuming that they
are always there.
1 parent 7ab6be2 commit dc3e06c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/test/test_coding.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import test.test_support, unittest
3-
from test.test_support import TESTFN
3+
from test.test_support import TESTFN, unlink
44
import os, sys
55

66
class CodingTest(unittest.TestCase):
@@ -45,8 +45,8 @@ def test_file_parse(self):
4545
__import__(TESTFN)
4646
finally:
4747
f.close()
48-
os.remove(TESTFN+".py")
49-
os.remove(TESTFN+".pyc")
48+
unlink(TESTFN+".py")
49+
unlink(TESTFN+".pyc")
5050
sys.path.pop(0)
5151

5252
def test_main():

0 commit comments

Comments
 (0)