MCPcopy Create free account
hub / github.com/dateutil/dateutil / assert_warned_from_this_file

Function assert_warned_from_this_file

tests/test_imports.py:58–65  ·  view source on GitHub ↗

The zoneinfo deprecation warning is attributed to the importing code.

(record)

Source from the content-addressed store, hash-verified

56
57
58def assert_warned_from_this_file(record):
59 """The zoneinfo deprecation warning is attributed to the importing code."""
60 filenames = [
61 os.path.normcase(os.path.splitext(w.filename)[0])
62 for w in record
63 if issubclass(w.category, DeprecationWarning)
64 ]
65 assert filenames == [os.path.normcase(os.path.splitext(__file__)[0])]
66
67
68def test_lazy_import_zoneinfo(clean_import):

Callers 4

Calls

no outgoing calls

Tested by

no test coverage detected