MCPcopy Index your code
hub / github.com/python/cpython / test_fromisocalendar_value_errors

Method test_fromisocalendar_value_errors

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

Source from the content-addressed store, hash-verified

2147 self.assertEqual(dobj, d_roundtrip)
2148
2149 def test_fromisocalendar_value_errors(self):
2150 isocals = [
2151 (2019, 0, 1),
2152 (2019, -1, 1),
2153 (2019, 54, 1),
2154 (2019, 1, 0),
2155 (2019, 1, -1),
2156 (2019, 1, 8),
2157 (2019, 53, 1),
2158 (10000, 1, 1),
2159 (0, 1, 1),
2160 (9999999, 1, 1),
2161 ]
2162 for isocal in isocals:
2163 with self.subTest(isocal=isocal):
2164 with self.assertRaises(ValueError):
2165 self.theclass.fromisocalendar(*isocal)
2166
2167 isocals = [
2168 (2<<32, 1, 1),
2169 (2019, 2<<32, 1),
2170 (2019, 1, 2<<32),
2171 ]
2172 for isocal in isocals:
2173 with self.subTest(isocal=isocal):
2174 with self.assertRaises((ValueError, OverflowError)):
2175 self.theclass.fromisocalendar(*isocal)
2176
2177 def test_fromisocalendar_type_errors(self):
2178 err_txformers = [

Callers

nothing calls this directly

Calls 3

fromisocalendarMethod · 0.80
subTestMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected