From ebdea82dfa0638576c91c510eca46e9f7c57b385 2021-11-07 23:49:12 From: Nikita Kniazev Date: 2021-11-07 23:49:12 Subject: [PATCH] Suppress bunch of self-deprecation warnings And exclude these deprecated modules from coverage report --- diff --git a/IPython/core/tests/test_display.py b/IPython/core/tests/test_display.py index b88bee8..c6e13b9 100644 --- a/IPython/core/tests/test_display.py +++ b/IPython/core/tests/test_display.py @@ -161,9 +161,11 @@ def _get_inline_config(): def test_set_matplotlib_close(): cfg = _get_inline_config() cfg.close_figures = False - display.set_matplotlib_close() + with pytest.deprecated_call(): + display.set_matplotlib_close() assert cfg.close_figures - display.set_matplotlib_close(False) + with pytest.deprecated_call(): + display.set_matplotlib_close(False) assert not cfg.close_figures _fmt_mime_map = { @@ -185,7 +187,8 @@ def test_set_matplotlib_formats(): (), ]: active_mimes = {_fmt_mime_map[fmt] for fmt in formats} - display.set_matplotlib_formats(*formats) + with pytest.deprecated_call(): + display.set_matplotlib_formats(*formats) for mime, f in formatters.items(): if mime in active_mimes: assert Figure in f @@ -201,8 +204,9 @@ def test_set_matplotlib_formats_kwargs(): cfg = _get_inline_config() cfg.print_figure_kwargs.update(dict(foo='bar')) kwargs = dict(dpi=150) - display.set_matplotlib_formats('png', **kwargs) - formatter = ip.display_formatter.formatters['image/png'] + with pytest.deprecated_call(): + display.set_matplotlib_formats("png", **kwargs) + formatter = ip.display_formatter.formatters["image/png"] f = formatter.lookup_by_type(Figure) formatter_kwargs = f.keywords expected = kwargs diff --git a/IPython/core/tests/test_pylabtools.py b/IPython/core/tests/test_pylabtools.py index 579e647..7888637 100644 --- a/IPython/core/tests/test_pylabtools.py +++ b/IPython/core/tests/test_pylabtools.py @@ -102,9 +102,9 @@ def test_select_figure_formats_str(): def test_select_figure_formats_kwargs(): ip = get_ipython() - kwargs = dict(quality=10, bbox_inches='tight') - pt.select_figure_formats(ip, 'png', **kwargs) - formatter = ip.display_formatter.formatters['image/png'] + kwargs = dict(bbox_inches="tight") + pt.select_figure_formats(ip, "png", **kwargs) + formatter = ip.display_formatter.formatters["image/png"] f = formatter.lookup_by_type(Figure) cell = f.keywords expected = kwargs diff --git a/codecov.yml b/codecov.yml index d65a8d9..dc3681c 100644 --- a/codecov.yml +++ b/codecov.yml @@ -6,3 +6,15 @@ coverage: target: auto codecov: require_ci_to_pass: false + +ignore: + - IPython/kernel/* + - IPython/consoleapp.py + - IPython/core/inputsplitter.py + - IPython/lib/inputhook*.py + - IPython/lib/kernel.py + - IPython/utils/jsonutil.py + - IPython/utils/localinterfaces.py + - IPython/utils/log.py + - IPython/utils/signatures.py + - IPython/utils/traitlets.py diff --git a/pytest.ini b/pytest.ini index 2287272..3aeec55 100644 --- a/pytest.ini +++ b/pytest.ini @@ -24,13 +24,6 @@ addopts = --durations=10 --ignore=IPython/external/qt_for_kernel.py --ignore=IPython/html/widgets/widget_link.py --ignore=IPython/html/widgets/widget_output.py - --ignore=IPython/lib/inputhookglut.py - --ignore=IPython/lib/inputhookgtk.py - --ignore=IPython/lib/inputhookgtk3.py - --ignore=IPython/lib/inputhookgtk4.py - --ignore=IPython/lib/inputhookpyglet.py - --ignore=IPython/lib/inputhookqt4.py - --ignore=IPython/lib/inputhookwx.py --ignore=IPython/terminal/console.py --ignore=IPython/terminal/ptshell.py --ignore=IPython/utils/_process_cli.py @@ -39,5 +32,16 @@ addopts = --durations=10 --ignore=IPython/utils/_process_win32_controller.py --ignore=IPython/utils/daemonize.py --ignore=IPython/utils/eventful.py + + --ignore=IPython/kernel + --ignore=IPython/consoleapp.py + --ignore=IPython/core/inputsplitter.py + --ignore-glob=IPython/lib/inputhook*.py + --ignore=IPython/lib/kernel.py + --ignore=IPython/utils/jsonutil.py + --ignore=IPython/utils/localinterfaces.py + --ignore=IPython/utils/log.py + --ignore=IPython/utils/signatures.py + --ignore=IPython/utils/traitlets.py doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS ipdoctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS