MCPcopy Index your code
hub / github.com/python/cpython / test_ignored_deprecations_are_silent

Method test_ignored_deprecations_are_silent

Lib/test/test_support.py:78–84  ·  view source on GitHub ↗

Test support.ignore_deprecations_from() silences warnings

(self)

Source from the content-addressed store, hash-verified

76 assert len(warnings._get_filters()) == orig_filter_len - 2
77
78 def test_ignored_deprecations_are_silent(self):
79 """Test support.ignore_deprecations_from() silences warnings"""
80 with warnings.catch_warnings(record=True) as warning_objs:
81 warnings_helper._warn_about_deprecation()
82 warnings.warn("You should NOT be seeing this.", DeprecationWarning)
83 messages = [str(w.message) for w in warning_objs]
84 self.assertEqual(len(messages), 0, messages)
85
86 def test_import_module(self):
87 import_helper.import_module("ftplib")

Callers

nothing calls this directly

Calls 3

strFunction · 0.85
warnMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected