MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / clear_warning_registry

Function clear_warning_registry

test/helpers_shared.py:245–249  ·  view source on GitHub ↗

Clear the __warningregistry__ for all modules.

()

Source from the content-addressed store, hash-verified

243
244# Helper method to workaround https://bugs.python.org/issue21724
245def clear_warning_registry():
246 """Clear the __warningregistry__ for all modules."""
247 for _, module in list(sys.modules.items()):
248 if hasattr(module, "__warningregistry__"):
249 module.__warningregistry__ = {} # type:ignore[attr-defined]
250
251
252class SystemCertsPatcher:

Callers 1

setUpMethod · 0.90

Calls 1

itemsMethod · 0.80

Tested by 1

setUpMethod · 0.72