summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* A quicker astimezone() implementation, rehabilitating an earlierTim Peters2003-01-011-0/+25
| | | | | | | | | | | | | | | | | | | suggestion from Guido, along with a formal correctness proof of the trickiest bit. The intricacy of the proof reveals how delicate this is, but also how robust the conclusion: correctness doesn't rely on dst() returning +- one hour (not all real time zones do!), it only relies on: 1. That dst() returns a (any) non-zero value if and only if daylight time is in effect. and 2. That the tzinfo subclass implements a consistent notion of time zone. The meaning of "consistent" was a hidden assumption, which is now an explicit requirement in the docs. Alas, it's an unverifiable (by the datetime implementation) requirement, but so it goes.
* Revert last change -- test works on HPUX again after Martin's checkinNeal Norwitz2003-01-011-3/+2
| | | | | | to 'properly configure the slave terminal' See SF patch # 656590 for the details.
* The failure of the last-second addition to the timezone coversion test isTim Peters2003-01-011-4/+12
| | | | | | understood now: it can't work. Added comments explaining why (it's "the usual"-- unrepresentable hours in local time --but in a slightly different guise).
* Comment out test, since it hangs on HPUX, still investigatingNeal Norwitz2002-12-311-2/+3
|
* Remove bogus test; the master is not a terminal on Solaris and HP-UX.Martin v. Löwis2002-12-311-2/+0
|
* A new, and much hairier, implementation of astimezone(), building onTim Peters2002-12-311-86/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | an idea from Guido. This restores that the datetime implementation never passes a datetime d to a tzinfo method unless d.tzinfo is the tzinfo instance whose method is being called. That in turn allows enormous simplifications in user-written tzinfo classes (see the Python sandbox US.py and EU.py for fully fleshed-out examples). d.astimezone(tz) also raises ValueError now if d lands in the one hour of the year that can't be expressed in tz (this can happen iff tz models both standard and daylight time). That it used to return a nonsense result always ate at me, and it turned out that it seemed impossible to force a consistent nonsense result under the new implementation (which doesn't know anything about how tzinfo classes implement their methods -- it can only infer properties indirectly). Guido doesn't like this -- expect it to change. New tests of conversion between adjacent DST-aware timezones don't pass yet, and are commented out. Running the datetime tests in a loop under a debug build leaks 9 references per test run, but I don't believe the datetime code is the cause (it didn't leak the last time I changed the C code, and the leak is the same if I disable all the tests that invoke the only function that changed here). I'll pursue that next.
* OS/2 EMX has no popen2.Popen3 even though bunzip2 is availableAndrew MacIntyre2002-12-311-1/+1
|
* add list of expected skips for the OS/2 EMX portAndrew MacIntyre2002-12-311-0/+28
|
* Make sure PrettyPrinter methods that mirror the module-levelFred Drake2002-12-311-3/+27
| | | | | convenience functions isreadable() and isrecursive() work the same way as the convenience functions.
* Add a test that InterpolationError is constructed properly and raisedFred Drake2002-12-311-2/+20
| | | | | when expected. Only applies to the ConfigParser and SafeConfigParser classes, not RawConfigParser.
* Updated the expected skips for MacOSX.Jack Jansen2002-12-301-0/+3
|
* Skip this test on MacOSX: the locale support is too minimal to makeJack Jansen2002-12-301-1/+3
| | | | it pass.
* Brett Cannon's dummy_thread and dummy_threading modules (SF patchGuido van Rossum2002-12-302-0/+237
| | | | 622537), with some nitpicking editorial changes.
* PEP 302 + zipimport:Just van Rossum2002-12-302-0/+384
| | | | | | | | | | | | | - new import hooks in import.c, exposed in the sys module - new module called 'zipimport' - various changes to allow bootstrapping from zip files I hope I didn't break the Windows build (or anything else for that matter), but then again, it's been sitting on sf long enough... Regarding the latest discussions on python-dev: zipimport sets pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as /path/to/Archive.zip/subdir/ are supported again.
* Add some missing tests. Should now test everything that pybsddb'sBarry Warsaw2002-12-301-24/+32
| | | | test suite tests.
* A step on the way to making tzinfo classes writable by mortals: get ridTim Peters2002-12-301-17/+38
| | | | | | | of the timetz case. A tzinfo method will always see a datetimetz arg, or None, now. In the former case, it's still possible that it will get a datetimetz argument belonging to a different timezone. That will get fixed next.
* Match new sequence behavior. User defined types now behave better as andNeil Schemenauer2002-12-301-2/+2
| | | | with sequences.
* Added tests that conversion to our own timezone is always an identity,Tim Peters2002-12-301-0/+13
| | | | | and that conversion to "timezone" None is the same as stripping the tzinfo member.
* Beefed up the timezone conversion test by adding a phony UTC zone that'sTim Peters2002-12-301-67/+81
| | | | | west of the US zones getting converted, and also by using Eastern "as if" it were UTC (wrt Pacific), and vice versa.
* String tests should test 8-bit strings :-)Marc-André Lemburg2002-12-301-1/+1
|
* Last checkin was missing the tuple comma.Raymond Hettinger2002-12-301-1/+1
| | | | The new "substr in str" feature masked the error.
* Restore the test of the random module after including "Random" in theRaymond Hettinger2002-12-301-1/+1
| | | | | | | | ignore tuple. The line, "from _random import Random as CoreGenerator", fools the test code which expects CoreGenerator.__name__ to be "CoreGenerator" instead of "Random".
* Temporarily comment out a test that crashes upon the introduction ofRaymond Hettinger2002-12-301-1/+1
| | | | the _random subclass for Random.
* This test depends on the exact ordering produced by the WichmannHillRaymond Hettinger2002-12-301-3/+3
| | | | | random number generator. Altered it a bit to use the old generator and restore the test.
* A start at non-trivial (== DST-aware) tests of timezone conversion.Tim Peters2002-12-291-0/+152
| | | | | | | Guido has in mind an easier way for users to code this stuff, but the only tests we have now are for fixed-offset tzinfo classes, and this stuff is extremely delicate in the endcases (read the new test code for why: there are holes in time <wink>).
* SF patch 658251: Install a C implementation of the Mersenne Twister as theRaymond Hettinger2002-12-291-14/+201
| | | | core generator for random.py.
* Patch for bug #659709: bogus computation of float lengthMarc-André Lemburg2002-12-292-0/+51
| | | | | Python 2.2.x backport candidate. (This bug has been around since Python 1.6.)
* Suppress unsafe *Cookie class warningsAndrew M. Kuchling2002-12-291-0/+5
|
* Make comparison and subtraction of aware objects ignore tzinfo if theTim Peters2002-12-271-8/+86
| | | | | | operands have identical tzinfo members (meaning object identity -- "is"). I misunderstood the intent here, reading wrong conclusion into conflicting clues.
* Also skip testHostnameRes() if gethostbyaddr() raises an exception.Guido van Rossum2002-12-261-1/+5
|
* Skip testHostnameRes() if gethostbyname() raises an exception.Guido van Rossum2002-12-261-1/+5
|
* Fix julian day problem with strptime. Note: XXX about using 0, suggestions?Neal Norwitz2002-12-261-0/+12
|
* Added tests to ensure that timetz comparison, and datetimetzTim Peters2002-12-261-9/+67
| | | | | | | | | | | subtraction, work as documented. In the Python implementation, they weren't calling utcoffset() if both operands had the same tzinfo object. That's fine if it so happens that the shared tzinfo object returns a fixed offset (independent of operand), but can give wrong results if that's not so, and the latter obtains in a tzinfo subclass instance trying to model both standard and daylight times. The C implementation was already doing this "correctly", so we're just adding tests to verify it.
* Implemented datetime.astimezone() and datetimetz.astimezone().Tim Peters2002-12-251-0/+53
|
* Whitespace normalization.Tim Peters2002-12-245-9/+8
|
* Add test for SF #658106. Will backport.Neal Norwitz2002-12-241-0/+4
|
* Implemented .replace() methods for date, datetime, datetimetz, time andTim Peters2002-12-241-0/+150
| | | | timetz.
* Don't rebind True and False.Tim Peters2002-12-231-5/+5
|
* I give up: unless I write my own strftime by hand, datetime just can'tTim Peters2002-12-221-0/+6
| | | | | | be trusted with years before 1900, so now we raise ValueError if a date or datetime or datetimetz .strftime() method is called with a year before 1900.
* Implemented a Wiki suggestion:Tim Peters2002-12-221-71/+118
| | | | | | | | | | | | {timetz,datetimetz}.{utcoffset,dst}() now return a timedelta (or None) instead of an int (or None). tzinfo.{utcoffset,dst)() can now return a timedelta (or an int, or None). Curiously, this was much easier to do in the C implementation than in the Python implementation (which lives in the Zope3 code tree) -- the C code already had lots of hair to extract C ints from offset objects, and used C ints internally.
* Added test to ensure that non-string result from dst() raises TypeError.Tim Peters2002-12-211-0/+6
|
* Changes sufficient so that pickles written by the Python implementationTim Peters2002-12-211-9/+15
| | | | can be read by the C implementation. I don't really understand this.
* format_utcoffset(): The natural type of the buflen arg is size_t, soTim Peters2002-12-201-9/+16
| | | | | | | | | | used that. wrap_strftime(): Removed the most irritating uses of buf. TestDate.test_ordinal_conversions(): The C implementation is fast enough that we can afford to check the endpoints of every year. Also added tm_yday tests at the endpoints.
* Expand log() tests to include long integers.Raymond Hettinger2002-12-181-0/+2
|
* This is Richie Hindle's patchMichael W. Hudson2002-12-171-0/+289
| | | | | | | | [ 643835 ] Set Next Statement for Python debuggers with a few tweaks by me: adding an unsigned or two, mentioning that not all jumps are allowed in the doc for pdb, adding a NEWS item and a note to whatsnew, and AuCTeX doing something cosmetic to libpdb.tex.
* Made this a little more compatible w/ the sandbox version, which isTim Peters2002-12-161-2/+2
| | | | still needed to test the Python implementatino.
* datetime escapes the sandbox. The Windows build is all set. I leave itTim Peters2002-12-161-0/+2128
| | | | | to others to argue about how to build it on other platforms (on Windows it's in its own DLL).
* Apply SF patch 652930: Add optional base argument to math.log(x[, base]).Raymond Hettinger2002-12-141-0/+1
|
* Tighten the tests for assignment to __bases__: disallow empty tuple.Guido van Rossum2002-12-131-0/+8
|
* Patch #536661: Improve performance of splitext. Add test_macpath.Martin v. Löwis2002-12-123-0/+79
|