TST: Use tempfiles in all tests. by jtratner · Pull Request #5419 · pandas-dev/pandas (original) (raw)
@jreback the point isn't to maintain the file path, it's that all the files we create for testing need to go into the temp directory. I added that make_tempfile=False part to work around pytables tests (otherwise they get littered everywhere). For example, I get this error when I try to use it with tempfile:
ERROR: pandas.io.tests.test_pytables:TestHDFStore.test_mode /usr/local/bin/vim +412 pandas/io/tests/test_pytables.py # test_mode check('r') /usr/local/bin/vim +377 pandas/io/tests/test_pytables.py # check self.assertRaises(IOError, HDFStore, path, mode=mode) /usr/local/bin/vim +475 ../python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py # assertRaises callableObj(*args, **kwargs) /usr/local/bin/vim +384 pandas/io/pytables.py # init self.open(mode=mode) /usr/local/bin/vim +504 pandas/io/pytables.py # open self._handle = h5_open(self._path, self._mode) /usr/local/bin/vim +230 pandas/io/pytables.py # h5_open return tables.openFile(path, mode) /usr/local/bin/vim +35 ../python2.7/site-packages/tables/_past.py # oldfunc return obj(*args, **kwargs) /usr/local/bin/vim +251 ../python2.7/site-packages/tables/file.py # open_file return File(filename, mode, title, root_uep, filters, **kwargs) /usr/local/bin/vim +527 ../python2.7/site-packages/tables/file.py # init self._g_new(filename, mode, **params) /usr/local/bin/vim +463 hdf5extension.pyx # tables.hdf5extension.File._g_new (tables/hdf5extension.c:4284) None HDF5ExtError: HDF5 error back trace
File "H5F.c", line 1582, in H5Fopen unable to open file File "H5F.c", line 1373, in H5F_open unable to read superblock File "H5Fsuper.c", line 334, in H5F_super_read unable to find file signature File "H5Fsuper.c", line 155, in H5F_locate_signature unable to find a valid file signature
End of HDF5 error back trace
Unable to open/create file '/var/folders/rz/5czmf6hj3kdbhbqwxz4klf8h0000gn/T/tmpcoEZWF__cJHxrUtdtb__.h5'