Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(13)  |  Call(12)  |  Derive(0)  |  Import(1)
date(year, month, day) --> date object

src/x/o/xoutil-1.5.4/tests/test_datetime.py   xoutil(Download)
import pytest
 
from xoutil.datetime import date
from xoutil.datetime import daterange
 
 
def test_daterange_stop_only():
    result = list(daterange(date(1978, 10, 21)))
    assert result[0] == date(1978, 10, 1)
    assert result[-1] == date(1978, 10, 20)
def test_daterange_empty():
    assert [] == list(daterange(date(1978, 10, 21), -2))
    assert [] == list(daterange(date(1978, 10, 21), date(1978, 10, 10)))
    assert [] == list(daterange(date(1978, 10, 10), date(1978, 10, 20), -1))