mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Catch OSError when trying to remove a file in case removal fails. This
should prevent a failure in tearDown masking any real test failure.
This commit is contained in:
parent
218072595e
commit
ce527883dc
1 changed files with 5 additions and 2 deletions
|
@ -32,7 +32,7 @@ class TransactionTests(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
try:
|
try:
|
||||||
os.remove(get_db_path())
|
os.remove(get_db_path())
|
||||||
except:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.con1 = sqlite.connect(get_db_path(), timeout=0.1)
|
self.con1 = sqlite.connect(get_db_path(), timeout=0.1)
|
||||||
|
@ -48,7 +48,10 @@ class TransactionTests(unittest.TestCase):
|
||||||
self.cur2.close()
|
self.cur2.close()
|
||||||
self.con2.close()
|
self.con2.close()
|
||||||
|
|
||||||
os.unlink(get_db_path())
|
try:
|
||||||
|
os.unlink(get_db_path())
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
def CheckDMLdoesAutoCommitBefore(self):
|
def CheckDMLdoesAutoCommitBefore(self):
|
||||||
self.cur1.execute("create table test(i)")
|
self.cur1.execute("create table test(i)")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue