Skip to content

DEPR: more deprecation warnings #16001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions pandas/tests/io/test_pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,23 @@ class TestHDFStore(Base, tm.TestCase):
def test_factory_fun(self):
path = create_tempfile(self.path)
try:
with get_store(path) as tbl:
raise ValueError('blah')
with catch_warnings(record=True):
with get_store(path) as tbl:
raise ValueError('blah')
except ValueError:
pass
finally:
safe_remove(path)

try:
with get_store(path) as tbl:
tbl['a'] = tm.makeDataFrame()
with catch_warnings(record=True):
with get_store(path) as tbl:
tbl['a'] = tm.makeDataFrame()

with get_store(path) as tbl:
self.assertEqual(len(tbl), 1)
self.assertEqual(type(tbl['a']), DataFrame)
with catch_warnings(record=True):
with get_store(path) as tbl:
self.assertEqual(len(tbl), 1)
self.assertEqual(type(tbl['a']), DataFrame)
finally:
safe_remove(self.path)

Expand Down Expand Up @@ -348,7 +351,7 @@ def test_api_default_format(self):

pandas.set_option('io.hdf.default_format', 'fixed')
df.to_hdf(path, 'df')
with get_store(path) as store:
with HDFStore(path) as store:
self.assertFalse(store.get_storer('df').is_table)
self.assertRaises(ValueError, df.to_hdf, path, 'df2', append=True)

Expand Down
8 changes: 5 additions & 3 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

from __future__ import print_function
from warnings import catch_warnings
import pytest
import unittest
import sqlite3
Expand Down Expand Up @@ -586,9 +587,10 @@ def test_to_sql_series(self):
tm.assert_frame_equal(s.to_frame(), s2)

def test_to_sql_panel(self):
panel = tm.makePanel()
self.assertRaises(NotImplementedError, sql.to_sql, panel,
'test_panel', self.conn)
with catch_warnings(record=True):
panel = tm.makePanel()
self.assertRaises(NotImplementedError, sql.to_sql, panel,
'test_panel', self.conn)

def test_roundtrip(self):
sql.to_sql(self.test_frame1, 'test_frame_roundtrip',
Expand Down