mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-85432: Harmonise parameter names between C and pure-Python implementations of datetime.time.strftime
, datetime.datetime.fromtimestamp
(#99993)
This commit is contained in:
parent
09edde95f4
commit
9cdb642997
3 changed files with 18 additions and 5 deletions
|
@ -2426,6 +2426,12 @@ class TestDateTime(TestDate):
|
|||
got = self.theclass.fromtimestamp(ts)
|
||||
self.verify_field_equality(expected, got)
|
||||
|
||||
def test_fromtimestamp_keyword_arg(self):
|
||||
import time
|
||||
|
||||
# gh-85432: The parameter was named "t" in the pure-Python impl.
|
||||
self.theclass.fromtimestamp(timestamp=time.time())
|
||||
|
||||
def test_utcfromtimestamp(self):
|
||||
import time
|
||||
|
||||
|
@ -3528,6 +3534,9 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase):
|
|||
except UnicodeEncodeError:
|
||||
pass
|
||||
|
||||
# gh-85432: The parameter was named "fmt" in the pure-Python impl.
|
||||
t.strftime(format="%f")
|
||||
|
||||
def test_format(self):
|
||||
t = self.theclass(1, 2, 3, 4)
|
||||
self.assertEqual(t.__format__(''), str(t))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue