Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a57d41

Browse files
authored
Merge pull request #13254 from Kojoley/deal-with-bunch-of-self-deprecation-warnings
Suppress bunch of self-deprecation warnings
2 parents 6e0cb96 + ebdea82 commit 1a57d41

4 files changed

Lines changed: 35 additions & 15 deletions

File tree

IPython/core/tests/test_display.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,11 @@ def _get_inline_config():
161161
def test_set_matplotlib_close():
162162
cfg = _get_inline_config()
163163
cfg.close_figures = False
164-
display.set_matplotlib_close()
164+
with pytest.deprecated_call():
165+
display.set_matplotlib_close()
165166
assert cfg.close_figures
166-
display.set_matplotlib_close(False)
167+
with pytest.deprecated_call():
168+
display.set_matplotlib_close(False)
167169
assert not cfg.close_figures
168170

169171
_fmt_mime_map = {
@@ -185,7 +187,8 @@ def test_set_matplotlib_formats():
185187
(),
186188
]:
187189
active_mimes = {_fmt_mime_map[fmt] for fmt in formats}
188-
display.set_matplotlib_formats(*formats)
190+
with pytest.deprecated_call():
191+
display.set_matplotlib_formats(*formats)
189192
for mime, f in formatters.items():
190193
if mime in active_mimes:
191194
assert Figure in f
@@ -201,8 +204,9 @@ def test_set_matplotlib_formats_kwargs():
201204
cfg = _get_inline_config()
202205
cfg.print_figure_kwargs.update(dict(foo='bar'))
203206
kwargs = dict(dpi=150)
204-
display.set_matplotlib_formats('png', **kwargs)
205-
formatter = ip.display_formatter.formatters['image/png']
207+
with pytest.deprecated_call():
208+
display.set_matplotlib_formats("png", **kwargs)
209+
formatter = ip.display_formatter.formatters["image/png"]
206210
f = formatter.lookup_by_type(Figure)
207211
formatter_kwargs = f.keywords
208212
expected = kwargs

IPython/core/tests/test_pylabtools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ def test_select_figure_formats_str():
102102

103103
def test_select_figure_formats_kwargs():
104104
ip = get_ipython()
105-
kwargs = dict(quality=10, bbox_inches='tight')
106-
pt.select_figure_formats(ip, 'png', **kwargs)
107-
formatter = ip.display_formatter.formatters['image/png']
105+
kwargs = dict(bbox_inches="tight")
106+
pt.select_figure_formats(ip, "png", **kwargs)
107+
formatter = ip.display_formatter.formatters["image/png"]
108108
f = formatter.lookup_by_type(Figure)
109109
cell = f.keywords
110110
expected = kwargs

codecov.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,15 @@ coverage:
1111
paths: '.*/tests/.*'
1212
codecov:
1313
require_ci_to_pass: false
14+
15+
ignore:
16+
- IPython/kernel/*
17+
- IPython/consoleapp.py
18+
- IPython/core/inputsplitter.py
19+
- IPython/lib/inputhook*.py
20+
- IPython/lib/kernel.py
21+
- IPython/utils/jsonutil.py
22+
- IPython/utils/localinterfaces.py
23+
- IPython/utils/log.py
24+
- IPython/utils/signatures.py
25+
- IPython/utils/traitlets.py

pytest.ini

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ addopts = --durations=10
2424
--ignore=IPython/external/qt_for_kernel.py
2525
--ignore=IPython/html/widgets/widget_link.py
2626
--ignore=IPython/html/widgets/widget_output.py
27-
--ignore=IPython/lib/inputhookglut.py
28-
--ignore=IPython/lib/inputhookgtk.py
29-
--ignore=IPython/lib/inputhookgtk3.py
30-
--ignore=IPython/lib/inputhookgtk4.py
31-
--ignore=IPython/lib/inputhookpyglet.py
32-
--ignore=IPython/lib/inputhookqt4.py
33-
--ignore=IPython/lib/inputhookwx.py
3427
--ignore=IPython/terminal/console.py
3528
--ignore=IPython/terminal/ptshell.py
3629
--ignore=IPython/utils/_process_cli.py
@@ -39,5 +32,16 @@ addopts = --durations=10
3932
--ignore=IPython/utils/_process_win32_controller.py
4033
--ignore=IPython/utils/daemonize.py
4134
--ignore=IPython/utils/eventful.py
35+
36+
--ignore=IPython/kernel
37+
--ignore=IPython/consoleapp.py
38+
--ignore=IPython/core/inputsplitter.py
39+
--ignore-glob=IPython/lib/inputhook*.py
40+
--ignore=IPython/lib/kernel.py
41+
--ignore=IPython/utils/jsonutil.py
42+
--ignore=IPython/utils/localinterfaces.py
43+
--ignore=IPython/utils/log.py
44+
--ignore=IPython/utils/signatures.py
45+
--ignore=IPython/utils/traitlets.py
4246
doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
4347
ipdoctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS

0 commit comments

Comments
 (0)