summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_time.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #22117: Add the new _PyTime_ROUND_FLOOR rounding method for the datetimeVictor Stinner2015-03-281-48/+18
| | | | | module. time.clock_settime() now uses this rounding method instead of _PyTime_ROUND_DOWN to handle correctly dates before 1970.
* Issue #22117: Write unit tests for _PyTime_AsTimeval()Victor Stinner2015-03-281-0/+38
| | | | | | | * _PyTime_AsTimeval() now ensures that tv_usec is always positive * _PyTime_AsTimespec() now ensures that tv_nsec is always positive * _PyTime_AsTimeval() now returns an integer on overflow instead of raising an exception
* Issue #22117: The signal modules uses the new _PyTime_t APIVictor Stinner2015-03-271-1/+28
| | | | | * Add _PyTime_AsTimespec() * Add unit tests for _PyTime_AsTimespec()
* Issue #22117: time.monotonic() now uses the new _PyTime_t APIVictor Stinner2015-03-271-10/+54
| | | | | | * Add _PyTime_FromNanoseconds() * Add _PyTime_AsSecondsDouble() * Add unit tests for _PyTime_AsSecondsDouble()
* Issue #22117: Fix rounding in _PyTime_FromSecondsObject()Victor Stinner2015-03-271-79/+173
| | | | | | * Rename _PyTime_FromObject() to _PyTime_FromSecondsObject() * Add _PyTime_AsNanosecondsObject() and _testcapi.pytime_fromsecondsobject() * Add unit tests
* Issue #11188, #19748: mktime() returns -1 on error. On Linux, the tm_wday fieldVictor Stinner2014-02-211-0/+7
| | | | | | is used as a sentinel () to detect if -1 is really an error or a valid timestamp. On AIX, tm_wday is unchanged even on success and so cannot be used as a sentinel.
* Issue #19748: On AIX, time.mktime() now raises an OverflowError for yearVictor Stinner2014-02-211-1/+1
| | | | outsize range [1902; 2037].
* Issue #20320: select.select() and select.kqueue.control() now round the timeoutVictor Stinner2014-02-161-35/+95
| | | | | | aways from zero, instead of rounding towards zero. It should make test_asyncio more reliable, especially test_timeout_rounding() test.
* Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-0/+3
|\
| * Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-0/+3
| |
* | Issue #20101: Merge with 3.3Zachary Ware2014-01-021-1/+2
|\ \ | |/
| * Issue #20101: Allow test_monotonic to pass on Windows machines on whichZachary Ware2014-01-021-1/+2
| | | | | | | | | | | | time.get_clock_info('monotonic').resolution == 0.015600099999999999 This is just a workaround pending a real resolution to #20101.
* | (Merge 3.3) Close #19999: tolerate coarse time when testing time.monotonic() onVictor Stinner2013-12-161-1/+1
|\ \ | |/ | | | | very busy/slow buildbot
| * Close #19999: tolerate coarse time when testing time.monotonic() on veryVictor Stinner2013-12-161-1/+1
| | | | | | | | busy/slow buildbot
* | Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-2/+1
|\ \ | |/
| * Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-2/+1
| |
* | Issue #19545: Avoid chained exceptions while passing stray % toSerhiy Storchaka2013-11-241-0/+4
|\ \ | |/ | | | | time.strptime(). Initial patch by Claudiu Popa.
| * Issue #19545: Avoid chained exceptions while passing stray % toSerhiy Storchaka2013-11-241-0/+4
| | | | | | | | time.strptime(). Initial patch by Claudiu Popa.
* | Issue #19715: Ensure that consecutive calls to monotonic() are monotonicVictor Stinner2013-11-221-0/+9
|/
* test_time.test_monotonic(): use a longer sleep to try to make the test more ↵Victor Stinner2013-07-031-2/+2
| | | | reliable
* #17690: test_time now works with unittest test discovery. Patch by Zachary ↵Ezio Melotti2013-04-111-15/+4
| | | | Ware.
* #17572: Avoid chained exceptions while passing bad directives to ↵Ezio Melotti2013-04-031-0/+6
| | | | time.strptime(). Initial patch by Claudiu Popa.
* Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-1/+1
|\ | | | | | | Patch by Serhiy Storchaka.
| * Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-1/+1
| | | | | | | | Patch by Serhiy Storchaka.
* | Issue #1667546: On platforms supporting tm_zone and tm_gmtoff fieldsAlexander Belopolsky2012-06-141-1/+52
| | | | | | | | | | | | in struct tm, time.struct_time objects returned by time.gmtime(), time.localtime() and time.strptime() functions now have tm_zone and tm_gmtoff attributes. Original patch by Paul Boddie.
* | Fix test_time for adjusted/adjustable changesVictor Stinner2012-06-121-6/+2
| |
* | PEP 418: Rename adjusted attribute to adjustable in time.get_clock_info() resultVictor Stinner2012-06-121-6/+6
| | | | | | | | | | | | | | | | Fix also its value on Windows and Linux according to its documentation: "adjustable" indicates if the clock *can be* adjusted, not if it is or was adjusted. In most cases, it is not possible to indicate if a clock is or was adjusted.
* | Fix sporadic failure of test_time.test_process_time() on WindowsVictor Stinner2012-06-011-2/+5
| | | | | | | | Use a threshold of 20 ms instead of 10 ms.
* | don't use assertEqual for test for bool equalityBenjamin Peterson2012-05-011-9/+9
| |
* | strip is_ prefixes on clock_info fieldsBenjamin Peterson2012-05-011-11/+11
| |
* | Issue #14428: Remove test_process_time_threads() from test_timeVictor Stinner2012-04-291-52/+0
| | | | | | | | | | The test is unstable and it's not really interesting to test exactly how threads are handled.
* | Issue #14428: Make test_process_time_threads() less strictVictor Stinner2012-04-291-1/+2
| |
* | Issue #14428: Rewrite test_process_time_threads() testVictor Stinner2012-04-291-7/+40
| | | | | | | | time.process_time() is CPU time, not a number of seconds.
* | Issue #14428, #14397: Implement the PEP 418Victor Stinner2012-04-291-12/+95
| | | | | | | | | | | | | | | | | | * Rename time.steady() to time.monotonic() * On Windows, time.monotonic() uses GetTickCount/GetTickCount64() instead of QueryPerformanceCounter() * time.monotonic() uses CLOCK_HIGHRES if available * Add time.get_clock_info(), time.perf_counter() and time.process_time() functions
* | Expose clock_settime() as time.clock_settime()Victor Stinner2012-04-021-0/+11
| |
* | Issue #10278: Add an optional strict argument to time.steady(), False by defaultVictor Stinner2012-03-151-0/+10
| |
* | Issue #10278: Drop time.monotonic() function, rename time.wallclock() to ↵Victor Stinner2012-03-141-22/+3
| | | | | | | | | | | | | | | | | | time.steady() * On Mac OS X, time.steady() now uses mach_absolute_time(), a monotonic clock * Optimistic change: bet that CLOCK_MONOTONIC and CLOCK_REALTIME are available when clock_gettime() is available * Rewrite time.steady() documentation
* | Close #14180: Factorize code to convert a number of seconds to time_t, ↵Victor Stinner2012-03-131-8/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | timeval or timespec time.ctime(), gmtime(), time.localtime(), datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now raises an OverflowError, instead of a ValueError, if the timestamp does not fit in time_t. datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now round microseconds towards zero instead of rounding to nearest with ties going away from zero.
* | Issue #13964: signal.sigtimedwait() timeout is now a float instead of a tupleVictor Stinner2012-03-021-1/+20
| | | | | | | | Add a private API to convert an int or float to a C timespec structure.
* | Backout f8409b3d6449: the PEP 410 is not accepted yetVictor Stinner2012-02-081-29/+4
| |
* | PEP 410Victor Stinner2012-02-081-4/+29
| |
* | Issue #13846: Add time.monotonic(), monotonic clock.Victor Stinner2012-02-071-1/+17
| |
* | Issue #13847: Fix test_time, time.gmtime() doesn't use localtime()Victor Stinner2012-01-291-1/+0
| | | | | | | | On Windows, localtime(-1) fails, but not gmtime(1).
* | Issue #13847: Make test_localtime_failure() more robustVictor Stinner2012-01-271-10/+15
| | | | | | | | Skip the test if we are unable to find an invalid time_t value.
* | Issue #13847: Fix test_mktime(), time.localtime() now raises OSErrorVictor Stinner2012-01-261-1/+1
| |
* | Issue #13847: time.localtime() and time.gmtime() now raise an OSError insteadVictor Stinner2012-01-261-0/+15
| | | | | | | | | | of ValueError on failure. time.ctime() and time.asctime() now raises an OSError if localtime() failed.
* | Issue #10278: wallclock() cannot go backward, but two consecutive callsVictor Stinner2012-01-231-1/+1
| | | | | | | | may return the same time.
* | Issue #10278: Be more explicit in tests than wallclock() is monotonic (cannotVictor Stinner2012-01-201-4/+9
| | | | | | | | go backward)
* | Be more lenient in test_wallclock (issue #10278).Antoine Pitrou2012-01-181-2/+2
| |
* | Close #10278: Add time.wallclock() function, monotonic clock.Victor Stinner2012-01-181-0/+7
| |