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

Method test_strftime_trailing_percent

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

Source from the content-addressed store, hash-verified

1625 t.strftime(format="%f")
1626
1627 def test_strftime_trailing_percent(self):
1628 # bpo-35066: Make sure trailing '%' doesn't cause datetime's strftime to
1629 # complain. Different libcs have different handling of trailing
1630 # percents, so we simply check datetime's strftime acts the same as
1631 # time.strftime.
1632 t = self.theclass(2005, 3, 2)
1633 try:
1634 _time.strftime('%')
1635 except ValueError:
1636 self.skipTest('time module does not support trailing %')
1637 self.assertEqual(t.strftime('%'), _time.strftime('%', t.timetuple()))
1638 self.assertEqual(
1639 t.strftime("m:%m d:%d y:%y %"),
1640 _time.strftime("m:03 d:02 y:05 %", t.timetuple()),
1641 )
1642
1643 def test_format(self):
1644 dt = self.theclass(2007, 9, 10)

Callers

nothing calls this directly

Calls 4

skipTestMethod · 0.80
strftimeMethod · 0.45
assertEqualMethod · 0.45
timetupleMethod · 0.45

Tested by

no test coverage detected