test_warnings.py 734 B

12345678910111213141516171819202122
  1. import pytest
  2. from pandas.util._test_decorators import async_mark
  3. import pandas._testing as tm
  4. class TestCategoricalWarnings:
  5. @async_mark()
  6. async def test_tab_complete_warning(self, ip):
  7. # https://github.com/pandas-dev/pandas/issues/16409
  8. pytest.importorskip("IPython", minversion="6.0.0")
  9. from IPython.core.completer import provisionalcompleter
  10. code = "import pandas as pd; c = pd.Categorical([])"
  11. await ip.run_code(code)
  12. # GH 31324 newer jedi version raises Deprecation warning;
  13. # appears resolved 2021-02-02
  14. with tm.assert_produces_warning(None):
  15. with provisionalcompleter("ignore"):
  16. list(ip.Completer.completions("c.", 1))