mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Closes #27710: Disallow fold not in [0, 1] in time and datetime constructors.
This commit is contained in:
parent
95e0df8389
commit
47649ab1f1
3 changed files with 36 additions and 11 deletions
|
@ -1724,6 +1724,11 @@ class TestDateTime(TestDate):
|
|||
self.assertRaises(ValueError, self.theclass,
|
||||
2000, 1, 31, 23, 59, 59,
|
||||
1000000)
|
||||
# bad fold
|
||||
self.assertRaises(ValueError, self.theclass,
|
||||
2000, 1, 31, fold=-1)
|
||||
self.assertRaises(ValueError, self.theclass,
|
||||
2000, 1, 31, fold=2)
|
||||
# Positional fold:
|
||||
self.assertRaises(TypeError, self.theclass,
|
||||
2000, 1, 31, 23, 59, 59, 0, None, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue