MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_tzinfo_utcnow

Method test_tzinfo_utcnow

Lib/test/datetimetester.py:5202–5211  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5200 self.assertEqual(expected, got.replace(tzinfo=None))
5201
5202 def test_tzinfo_utcnow(self):
5203 meth = self.theclass.utcnow
5204 # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
5205 with self.assertWarns(DeprecationWarning):
5206 base = meth()
5207 # Try with and without naming the keyword; for whatever reason,
5208 # utcnow() doesn't accept a tzinfo argument.
5209 off42 = FixedOffset(42, "42")
5210 self.assertRaises(TypeError, meth, off42)
5211 self.assertRaises(TypeError, meth, tzinfo=off42)
5212
5213 def test_tzinfo_utcfromtimestamp(self):
5214 import time

Callers

nothing calls this directly

Calls 4

methFunction · 0.85
assertWarnsMethod · 0.80
FixedOffsetClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected