File: test_shimmodule.py

package info (click to toggle)
ipython 5.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,428 kB
  • ctags: 4,941
  • sloc: python: 33,657; makefile: 170; sh: 139
file content (15 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import sys
import warnings

import nose.tools as nt

from IPython.utils.capture import capture_output
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)