File: test_shimmodule.py

package info (click to toggle)
ipython 7.20.0-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,100 kB
  • sloc: python: 36,813; sh: 379; makefile: 243
file content (13 lines) | stat: -rw-r--r-- 344 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
import sys
import warnings

from IPython.utils.shimmodule import ShimWarning


def test_shim_warning():
    sys.modules.pop('IPython.config', None)
    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter("always")
        import IPython.config
    assert len(w) == 1
    assert issubclass(w[-1].category, ShimWarning)