MCPcopy Create free account
hub / github.com/dateutil/dateutil / __make_date_examples

Function __make_date_examples

tests/test_isoparser.py:344–367  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

342###
343# Test parse_isodate
344def __make_date_examples():
345 dates_no_day = [
346 date(1999, 12, 1),
347 date(2016, 2, 1)
348 ]
349
350 if not six.PY2:
351 # strftime does not support dates before 1900 in Python 2
352 dates_no_day.append(date(1000, 11, 1))
353
354 # Only one supported format for dates with no day
355 o = zip(dates_no_day, it.repeat('%Y-%m'))
356
357 dates_w_day = [
358 date(1969, 12, 31),
359 date(1900, 1, 1),
360 date(2016, 2, 29),
361 date(2017, 11, 14)
362 ]
363
364 dates_w_day_fmts = ('%Y%m%d', '%Y-%m-%d')
365 o = it.chain(o, it.product(dates_w_day, dates_w_day_fmts))
366
367 return list(o)
368
369
370@pytest.mark.parametrize('d,dt_fmt', __make_date_examples())

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected