]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
test_time: rewrite PyTime API rounding tests
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 9 Sep 2015 20:32:48 +0000 (22:32 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 9 Sep 2015 20:32:48 +0000 (22:32 +0200)
commit3e2c8d84c69063b8042a75ba04b5e75b1de0704e
tree0b76315fb3c840687934abb5b40ecf9a92dbeaac
parent9ae47dfbd9b2f094205faad758b32803bea8e463
test_time: rewrite PyTime API rounding tests

Drop all hardcoded tests. Instead, reimplement each function in Python, usually
using decimal.Decimal for the rounding mode.

Add much more values to the dataset. Test various timestamp units from
picroseconds to seconds, in integer and float.

Enhance also _PyTime_AsSecondsDouble().
Lib/test/test_time.py
Python/pytime.c