def test_read_hdf_multiply_open():
 pytest.importorskip('tables')
 df = pd.DataFrame({'x': ['a', 'b', 'c', 'd'], 'y': [1, 2, 3, 4]}, index=[1.0, 2.0, 3.0, 4.0])
 with tmpfile('h5') as fn:
  df.to_hdf(fn, '/data', format='table')
  with pd.HDFStore(fn, mode='r'):
   dd.read_hdf(fn, '/data', chunksize=2, mode='r')

def test_read_hdf_multiply_open ( ) : pytest . importorskip ( 'tables' ) df = pd . DataFrame ( { 'x' : [ 'a' , 'b' , 'c' , 'd' ] , 'y' : [ 1 , 2 , 3 , 4 ] } , index = [ 1.0 , 2.0 , 3.0 , 4.0 ] ) with tmpfile ( 'h5' ) as fn : df . to_hdf ( fn , '/data' , format = 'table' ) with pd . HDFStore ( fn , mode = 'r' ) : dd . read_hdf ( fn , '/data' , chunksize = 2 , mode = 'r' )
test that we can read from a file thats already opened elsewhere in read-only mode .