@@ -150,20 +150,23 @@ class TestHDFStore(Base, tm.TestCase):
150
150
def test_factory_fun (self ):
151
151
path = create_tempfile (self .path )
152
152
try :
153
- with get_store (path ) as tbl :
154
- raise ValueError ('blah' )
153
+ with catch_warnings (record = True ):
154
+ with get_store (path ) as tbl :
155
+ raise ValueError ('blah' )
155
156
except ValueError :
156
157
pass
157
158
finally :
158
159
safe_remove (path )
159
160
160
161
try :
161
- with get_store (path ) as tbl :
162
- tbl ['a' ] = tm .makeDataFrame ()
162
+ with catch_warnings (record = True ):
163
+ with get_store (path ) as tbl :
164
+ tbl ['a' ] = tm .makeDataFrame ()
163
165
164
- with get_store (path ) as tbl :
165
- self .assertEqual (len (tbl ), 1 )
166
- self .assertEqual (type (tbl ['a' ]), DataFrame )
166
+ with catch_warnings (record = True ):
167
+ with get_store (path ) as tbl :
168
+ self .assertEqual (len (tbl ), 1 )
169
+ self .assertEqual (type (tbl ['a' ]), DataFrame )
167
170
finally :
168
171
safe_remove (self .path )
169
172
@@ -348,7 +351,7 @@ def test_api_default_format(self):
348
351
349
352
pandas .set_option ('io.hdf.default_format' , 'fixed' )
350
353
df .to_hdf (path , 'df' )
351
- with get_store (path ) as store :
354
+ with HDFStore (path ) as store :
352
355
self .assertFalse (store .get_storer ('df' ).is_table )
353
356
self .assertRaises (ValueError , df .to_hdf , path , 'df2' , append = True )
354
357
0 commit comments