mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Use test_support.unlink() instead of os.unlink().
This commit is contained in:
parent
8d9db047d2
commit
94b59bb144
1 changed files with 3 additions and 4 deletions
|
@ -1,4 +1,3 @@
|
||||||
import os
|
|
||||||
import unittest
|
import unittest
|
||||||
import shelve
|
import shelve
|
||||||
import glob
|
import glob
|
||||||
|
@ -6,11 +5,11 @@ from test import test_support
|
||||||
|
|
||||||
class TestCase(unittest.TestCase):
|
class TestCase(unittest.TestCase):
|
||||||
|
|
||||||
fn = "shelftemp" + os.extsep + "db"
|
fn = "shelftemp.db"
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
for f in glob.glob(self.fn+"*"):
|
for f in glob.glob(self.fn+"*"):
|
||||||
os.unlink(f)
|
test_support.unlink(f)
|
||||||
|
|
||||||
def test_ascii_file_shelf(self):
|
def test_ascii_file_shelf(self):
|
||||||
s = shelve.open(self.fn, protocol=0)
|
s = shelve.open(self.fn, protocol=0)
|
||||||
|
@ -97,7 +96,7 @@ class TestShelveBase(mapping_tests.BasicTestMappingProtocol):
|
||||||
self._db = []
|
self._db = []
|
||||||
if not self._in_mem:
|
if not self._in_mem:
|
||||||
for f in glob.glob(self.fn+"*"):
|
for f in glob.glob(self.fn+"*"):
|
||||||
os.unlink(f)
|
test_support.unlink(f)
|
||||||
|
|
||||||
class TestAsciiFileShelve(TestShelveBase):
|
class TestAsciiFileShelve(TestShelveBase):
|
||||||
_args={'protocol':0}
|
_args={'protocol':0}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue