mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Have test_coding conditionally remove test files instead of assuming that they
are always there.
This commit is contained in:
parent
7ab6be216a
commit
dc3e06ce3a
1 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import test.test_support, unittest
|
import test.test_support, unittest
|
||||||
from test.test_support import TESTFN
|
from test.test_support import TESTFN, unlink
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
class CodingTest(unittest.TestCase):
|
class CodingTest(unittest.TestCase):
|
||||||
|
@ -45,8 +45,8 @@ class CodingTest(unittest.TestCase):
|
||||||
__import__(TESTFN)
|
__import__(TESTFN)
|
||||||
finally:
|
finally:
|
||||||
f.close()
|
f.close()
|
||||||
os.remove(TESTFN+".py")
|
unlink(TESTFN+".py")
|
||||||
os.remove(TESTFN+".pyc")
|
unlink(TESTFN+".pyc")
|
||||||
sys.path.pop(0)
|
sys.path.pop(0)
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue