summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_time.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.5] bpo-13617: Reject embedded null characters in wchar* strings. ↵Serhiy Storchaka2017-06-281-0/+4
| | | | | | | | | | (GH-2302) (#2463) Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.. (cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)
* More typos in 3.5 documentation and commentsMartin Panter2015-10-071-2/+2
|
* Issue #25155: Fix _PyTime_Divide() roundingVictor Stinner2015-09-181-8/+8
| | | | | _PyTime_Divide() rounding was wrong: copy code from Python default which has now much better unit tests.
* Issue #24917: time_strftime() buffer over-read.Steve Dower2015-09-071-0/+13
|
* Backing out 09b62202d9b7; the tests fail on Linux, and it needs a re-think.Larry Hastings2015-09-061-6/+0
|
* Issue #24917: time_strftime() Buffer Over-read. Patch by John Leitch.Steve Dower2015-09-051-0/+6
|
* Closes #24244: Removes invalid test from test_timeSteve Dower2015-06-241-7/+0
|
* Issue #22117: Add a new _PyTime_FromSeconds() functionVictor Stinner2015-04-031-0/+7
| | | | | Fix also _Py_InitializeEx_Private(): initialize time before initializing import, import_init() uses the _PyTime API (for thread locks).
* Issue #22117, issue #23485: Fix _PyTime_AsMilliseconds() andVictor Stinner2015-04-011-4/+72
| | | | | | _PyTime_AsMicroseconds() rounding. Add also unit tests.
* Issue #22117: Remove _PyTime_ROUND_DOWN and _PyTime_ROUND_UP rounding methodsVictor Stinner2015-03-301-87/+13
| | | | Use _PyTime_ROUND_FLOOR and _PyTime_ROUND_CEILING instead.
* Issue #22117: Add _PyTime_ROUND_CEILING rounding method for timestampsVictor Stinner2015-03-301-4/+61
| | | | Add also more tests for ROUNd_FLOOR.
* Issue #22117: Fix rounding and implement _PyTime_ROUND_FLOOR in:Victor Stinner2015-03-291-2/+2
| | | | | | - _PyTime_ObjectToTime_t() - _PyTime_ObjectToTimespec() - _PyTime_ObjectToTimeval()
* 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.