diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2009-12-18 15:37:48 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2009-12-18 15:37:48 (GMT) |
commit | e8c12559fd30115549a1aa4bcffa078ff1231ecc (patch) | |
tree | 757a109e3a5cb7f74c92e2bf33ac76cf72d1e6f5 /Lib/test/test_strptime.py | |
parent | 695de9694345801c147144d9e7112a85960a935b (diff) | |
download | cpython-e8c12559fd30115549a1aa4bcffa078ff1231ecc.zip cpython-e8c12559fd30115549a1aa4bcffa078ff1231ecc.tar.gz cpython-e8c12559fd30115549a1aa4bcffa078ff1231ecc.tar.bz2 |
Merged revisions 76875 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r76875 | ezio.melotti | 2009-12-18 17:35:27 +0200 (Fri, 18 Dec 2009) | 9 lines
Merged revisions 76804 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76804 | ezio.melotti | 2009-12-13 20:54:53 +0200 (Sun, 13 Dec 2009) | 1 line
#7342: make sure that the datetime object in test_fraction always has a number of microseconds != 0
........
................
Diffstat (limited to 'Lib/test/test_strptime.py')
-rw-r--r-- | Lib/test/test_strptime.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index 9008717..e0263b4 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -274,10 +274,11 @@ class StrptimeTests(unittest.TestCase): self.helper('S', 5) def test_fraction(self): + # Test microseconds import datetime - now = datetime.datetime.now() - tup, frac = _strptime._strptime(str(now), format="%Y-%m-%d %H:%M:%S.%f") - self.assertEqual(frac, now.microsecond) + d = datetime.datetime(2012, 12, 20, 12, 34, 56, 78987) + tup, frac = _strptime._strptime(str(d), format="%Y-%m-%d %H:%M:%S.%f") + self.assertEqual(frac, d.microsecond) def test_weekday(self): # Test weekday directives |