File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -170,10 +170,16 @@ def test_in_transaction_ro(self):
170
170
with self .assertRaises (AttributeError ):
171
171
self .cx .in_transaction = True
172
172
173
+
174
+ class OpenTests (unittest .TestCase ):
175
+ def tearDown (self ):
176
+ import gc
177
+ gc .collect ()
178
+ unlink (TESTFN )
179
+
173
180
def test_open_with_path_like_object (self ):
174
181
""" Checks that we can successfully connect to a database using an object that
175
182
is PathLike, i.e. has __fspath__(). """
176
- self .addCleanup (unlink , TESTFN )
177
183
class Path :
178
184
def __fspath__ (self ):
179
185
return TESTFN
@@ -182,7 +188,6 @@ def __fspath__(self):
182
188
cx .execute ('create table test(id integer)' )
183
189
184
190
def test_open_uri (self ):
185
- self .addCleanup (unlink , TESTFN )
186
191
with sqlite .connect (TESTFN ) as cx :
187
192
cx .execute ('create table test(id integer)' )
188
193
with sqlite .connect ('file:' + TESTFN , uri = True ) as cx :
@@ -942,6 +947,7 @@ def suite():
942
947
CursorTests ,
943
948
ExtensionTests ,
944
949
ModuleTests ,
950
+ OpenTests ,
945
951
SqliteOnConflictTests ,
946
952
ThreadTests ,
947
953
]
You can’t perform that action at this time.
0 commit comments