summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_strptime.py
Commit message (Collapse)AuthorAgeFilesLines
* * Migrate set() and frozenset() from the sandbox.Raymond Hettinger2003-11-161-4/+3
| | | | | | | | * Install the unittests, docs, newsitem, include file, and makefile update. * Exercise the new functions whereever sets.py was being used. Includes the docs for libfuncs.tex. Separate docs for the types are forthcoming.
* Make sure parentheses are escaped when used in the format string.Brett Cannon2003-08-291-0/+9
| | | | Closes bug #796149 . Will be backported.
* Fix bug in test_bad_timezone where test was assuming locale knew of PDT.Brett Cannon2003-08-111-2/+3
|
* Fix handling of bad locale setup where time.tzname[0] == time.tzname[1] andBrett Cannon2003-08-111-0/+20
| | | | | | time.daylight is true. Add an explicit test for this situation. Fixed some wording in docstrings.
* Re-introduce caching of TimeRE and compiled regexes with added thread-safety.Brett Cannon2003-08-051-60/+54
| | | | | | | | | | | | Also remove now unnecessary property attributes for thread safety (no longer have lazy attributes) and code simplicity reasons. Timezone storage has been reworked to be simpler and more flexible. All values in LocaleTime instances are lower-cased. This is all done to simplify the module. The module now assumes nothing beyond the strptime function will be exposed for general use beyond providing functionality for strptime.
* Remove caching of TimeRE (and thus LocaleTime) instance. Error was beingBrett Cannon2003-07-241-7/+10
| | | | | | caught when executing test_strptime, test_logging, and test_time in that order when the testing of "%c" occured. Suspect the cache was not being recreated (the test passed when test_logging was forced to re-establish the locale).
* Fix error in test of not comparing against 0 item of a listBrett Cannon2003-07-221-1/+1
|
* Fixes bug of timezone value being left as -1 when ``time.tzname[0] ==Brett Cannon2003-07-031-3/+3
| | | | | | | time.tzname[1] and not time.daylight`` is true when it should only when time.daylight is true. Tests are also fixed. Closes bug #763047 and its cohort #763052.
* Fix typo in error messageNeal Norwitz2003-06-301-1/+1
|
* Removed invalid test.Raymond Hettinger2003-06-291-3/+0
| | | | | | | | | Analysis by Bob Halley: The test seems to expect that if time.daylight is true, then the is_dst field of the tm structure will be 1 too. But this isn't the case, since daylight is true if the timezone does DST, *not* if DST is in effect.
* Beefed up timezone support. UTC and GMT are now always recognized timezonesBrett Cannon2003-05-111-5/+14
| | | | | with values of 0. Also now check time.daylight to see if time.tzname[1] should be used in timezone checking.
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-8/+8
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Raise a ValueError when there is data that was not covered in the format ↵Brett Cannon2003-04-281-0/+4
| | | | string. Done to match behavior of pre-existing C-based strptime implementations.
* Make _strptime escape regex syntax in format string to prevent use in ↵Brett Cannon2003-04-191-0/+14
| | | | internal regex.
* SF patch #691928: Use datetime in _strptimeRaymond Hettinger2003-03-091-32/+38
| | | | | | | | | | | | Contributed by Brett Cannon. To prevent code duplication, I patched _strptime to use datetime's date object to do Julian day, Gregorian, and day of the week calculations. Patch also includes new regression tests to test results and the calculation gets triggered. Very minor comment changes and the contact email are also changed.
* SF patch 670012: Compatibility changes for _strptime.py.Tim Peters2003-01-181-47/+38
| | | | | | | | | | | | | | | Patch from Brett Cannon: First, the 'y' directive now handles [00, 68] as a suffix for the 21st century while [69, 99] is treated as the suffix for the 20th century (this is for Open Group compatibility). strptime now returns default values that make it a valid date ... the ability to pass in a regex object to use instead of a format string (and the inverse ability to have strptime return a regex object) has been removed. This is in preparation for a future patch that will add some caching internally to get a speed boost.
* Fix julian day problem with strptime. Note: XXX about using 0, suggestions?Neal Norwitz2002-12-261-0/+12
|
* Patch #639112: fixes for None locale and tz.Martin v. Löwis2002-11-271-56/+141
|
* Brett's fixes for various bugs and coding issues. Closes SF patch #Barry Warsaw2002-09-231-7/+26
| | | | | 593560, with some minor cleanups, line folding and whitespace normalization by Barry.
* Delete the %c test from test_date_time() untill Brett Cannon has timeGuido van Rossum2002-09-031-2/+2
| | | | | | to fix it. (It fails when the day of the month is a 1-digit number, because %c produces space+digit there, while strptime seems to expect zero+digit somehow.)
* The test I saw failing this morning just happened to be run at 8amBarry Warsaw2002-08-291-0/+12
| | | | | | | | localtime, which in -0400 is 12 noon GMT. The bug boiled down to broken conversion of 12 PM to hour 12 for the '%I %p' format string. Added a test for this specific condition: Strptime12AMPMTests. Fix to _strptime.py coming momentarily.
* Standardize behavior: no docstrings in test functions; add a properGuido van Rossum2002-08-221-46/+44
| | | | test_main() that creates a suite and runs it. Don't mess with sys.path!!!
* Whitespace normalization.Tim Peters2002-08-081-10/+10
|
* Pure Python strptime implementation by Brett Cannon. See SF patch 474274.Guido van Rossum2002-07-191-0/+279
Also adds tests.