Commit Graph

1670 Commits

Author SHA1 Message Date
Tim Peters 1e33ffa5c7 test_resource has no chance of running on Windows. 2002-04-23 23:09:02 +00:00
Tim Peters e12cda9840 test_mmap started breaking on Windows, only when run after test_bsddb.
On Win2K it thought 'foo' started at byte offset 0 instead of at the
pagesize, and on Win98 it thought 'foo' didn't exist at all.  Somehow
or other this is related to the new "in memory file" gimmicks in
bsddb, but the old bsddb we use on Windows sucks so bad anyway I don't
want to bother digging deeper.  Flushing the file in test_mmap after
writing to it makes the problem go away, so good enough.
2002-04-23 23:07:28 +00:00
Barry Warsaw 906569de24 Unit tests for the changes in abstract.c version 2.101. The debug
build's "undetected error" problems were originally detected with
extension types, but we can whitebox test the same situations with
new-style classes.
2002-04-23 22:48:42 +00:00
Barry Warsaw 5ca537473b Rewrote the PyUnit description so that it now recommends to use
run_suite() instead of run_unittest().  Best practice is to plan for
multiple test classes.
2002-04-23 21:39:00 +00:00
Jeremy Hylton 74ce77f0e6 Add tests for the recent resource module change.
Also add a test that Python doesn't die with SIGXFSZ if it exceeds the
file rlimit.  (Assuming this will also test the behavior when the 2GB
limit is exceed on a platform that doesn't have large file support.)
2002-04-23 20:21:22 +00:00
Jack Jansen 1476c2753b There was a non-ascii character in the source. Replaced by a hex escape. 2002-04-23 10:52:44 +00:00
Anthony Baxter 4ce6b351cc don't fail if the audio device is busy, just skip.
SF patch 545486
2002-04-23 02:20:46 +00:00
Anthony Baxter 8388895fe4 SF patch [ 545523 ] patch for 514433 bsddb.dbopen (NULL)
closes SF #514433

can now pass 'None' as the filename for the bsddb.*open functions,
and you'll get an in-memory temporary store.

docs are ripped out of the bsddb dbopen man page. Fred may want to
clean them up.

Considering this for 2.2, but not 2.1.
2002-04-23 02:11:05 +00:00
Walter Dörwald de02bcb265 Apply patch diff.txt from SF feature request
http://www.python.org/sf/444708

This adds the optional argument for str.strip
to unicode.strip too and makes it possible
to call str.strip with a unicode argument
and unicode.strip with a str argument.
2002-04-22 17:42:37 +00:00
Tim Peters 639295f0a5 Enable universal newlines on Windows. Note that NEWS needs more words! 2002-04-21 07:30:30 +00:00
Tim Peters ea572b21f8 Assorted code cleanups for readability. Greatly boosted the size of the
test data:  this test fails on WIndows now if universal newlines are
enabled (which they aren't yet, by default).  I don't know whether the
test will also fail on Linux now.
2002-04-21 06:12:02 +00:00
Jeremy Hylton 954aed8c8d Add test for eval() w/ free variables.
Related to SF bug #505315
2002-04-20 04:51:39 +00:00
Jeremy Hylton c72737e7b6 Fix SF #544995 (zlib crash on second flush call)
Bug fix by mhammond.

Bug fix candidate for 2.2, not present in 2.1.
2002-04-19 14:37:07 +00:00
Mark Hammond 3b959dbcaf Fix bug 544473 - "Queue module can deadlock".
Use try/finally to ensure all Queue locks remain stable.
Includes test case.  Bugfix candidate.
2002-04-19 00:11:32 +00:00
Tim Peters afb2c80b29 ceval.c/do_raise(): Tighten the test to disallow raising an instance of
a str subclass.

test_descr.py/string_exceptions():  New sub-test.

For 2.3 only.  Guido doesn't want this backported.
2002-04-18 18:06:20 +00:00
Tim Peters 5379dea2a7 SF bug 544733: Cygwin test_mmap fix for Python 2.2.1
Close a file before trying to unlink it, and apparently Cygwin needs
writes to an mmap'ed file to get flushed before they're visible.

Bugfix candidate, but I think only for the 2.2 line (it's testing
features that I think were new in 2.2).
2002-04-18 04:30:18 +00:00
Guido van Rossum d99b3e78dd SF bug 542984.
Change type_get_doc (the get function for __doc__) to look in tp_dict
more often, and if it finds a descriptor in tp_dict, to call it (with
a NULL instance).  This means you can add a __doc__ descriptor to a
new-style class that returns instance docs when called on an instance,
and class docs when called on a class -- or the same docs in either
case, but lazily computed.

I'll also check this into the 2.2 maintenance branch.
2002-04-18 00:27:33 +00:00
Walter Dörwald 2ee4be0775 Apply diff3.txt from SF patch http://www.python.org/sf/536241
If a str or unicode method returns the original object,
make sure that for str and unicode subclasses the original
will not be returned.

This should prevent SF bug http://www.python.org/sf/460020
from reappearing.
2002-04-17 21:34:05 +00:00
Guido van Rossum e8fc640349 SF bug 544647.
PyNumber_InPlaceMultiply insisted on calling sq_inplace_repeat if it
existed, even if nb_inplace_multiply also existed and the arguments
weren't right for sq_inplace_repeat.  Change this to only use
sq_inplace_repeat if nb_inplace_multiply isn't defined.

Bugfix candidate.
2002-04-16 16:44:51 +00:00
Barry Warsaw 4eaf50f435 test_mktime(): Removed. This wasn't really testing anything useful
(or platform independent).  Closes SF bug #460357.

Bug fix candidate.
2002-04-16 12:37:55 +00:00
Barry Warsaw 16f9055a9b Whitespace normalization, while using non-whitespace literals for
intended whitespace.
2002-04-16 05:06:42 +00:00
Guido van Rossum 6184c117e9 Expect test_email_codecs to be skipped -- few users or developers will
have the needed optional Japanese codecs installed.
2002-04-16 02:14:04 +00:00
Tim Peters 27dba87b78 Apparently 3 of the tests here rely on trailing whitespace and/or hard
tab characters, so reverting the whitespace normalization.  Barry,
please repair this.
2002-04-16 02:08:51 +00:00
Tim Peters 4d9b466ea5 Fewer deprecation warnings. 2002-04-16 01:59:17 +00:00
Tim Peters 863ac44b74 Whitespace normalization. 2002-04-16 01:38:40 +00:00
Tim Peters d392506c43 Tighten up some warning filters, and break some dependencies on the
order in which the tests are normally run.
2002-04-16 01:27:44 +00:00
Tim Peters 50ac30ee01 OK, don't call resetwarnings(). 2002-04-16 00:29:27 +00:00
Tim Peters 7d79948103 It makes more sense to call resetwarnings() after every test runs than
to keep doing that in every test that wants to filter a warning.
2002-04-16 00:01:09 +00:00
Tim Peters a91a02a76d I expect test_univnewlines to be skipped on Windows. I expect this
because it *is* skipped.  I'm not entirely sure it should be skipped, but
figuring that out would take actual thought <wink>.
2002-04-15 23:56:04 +00:00
Tim Peters f022a4d451 Reduce the number of test-suite DeprecationWarnings; start adding
resetwarnings() calls too.
2002-04-15 23:52:04 +00:00
Barry Warsaw c9ad32c5d1 test_main(): Added this so the test can actually get run under the
regrtest framework.  Keep the original standalone-unittest
scaffolding (i.e. suite() and __main__).
2002-04-15 22:14:06 +00:00
Walter Dörwald 068325ef92 Apply the second version of SF patch http://www.python.org/sf/536241
Add a method zfill to str, unicode and UserString and change
Lib/string.py accordingly.

This activates the zfill version in unicodeobject.c that was
commented out and implements the same in stringobject.c. It also
adds the test for unicode support in Lib/string.py back in and
uses repr() instead() of str() (as it was before Lib/string.py 1.62)
2002-04-15 13:36:47 +00:00
Guido van Rossum b6b8942f53 SF bug #541883 (Vincent Fiack).
A stupid bug in object_set_class(): didn't check for value==NULL
before checking its type.

Bugfix candidate.
2002-04-15 01:03:30 +00:00
Tim Peters 077f27141f SF bug 543840: complex(string) accepts strings with \0
complex_subtype_from_string():  this stopped parsing at the first 0
byte, as if that were the end of the input string.

Bugfix candidate.
2002-04-14 22:04:03 +00:00
Jack Jansen 518d261f63 Test suite for universal newline support. 2002-04-14 20:17:18 +00:00
Martin v. Löwis 2f6d4da278 Patch #542569: tp_print tp_repr tp_str in test_bool.py. 2002-04-14 10:22:29 +00:00
Guido van Rossum 018b0eb0f5 Partially implement SF feature request 444708.
Add optional arg to string methods strip(), lstrip(), rstrip().
The optional arg specifies characters to delete.

Also for UserString.

Still to do:

- Misc/NEWS
- LaTeX docs (I did the docstrings though)
- Unicode methods, and Unicode support in the string methods.
2002-04-13 00:56:08 +00:00
Guido van Rossum d854f3b3cc I am mad. This test never worked!
The test function's signature should be

    test(methodname, input, output, *args)

but the output argument was omitted.  This caused all tests to fail,
because the expected output was passed as the initial argument to the
method call.  But because of the way the test works (it compares the
results for a regular string to the results for a UserString instance
with the same value, and it's OK if both raise the same exception) the
test never failed!

I've fixed this, and also cleaned up a few warts in the verbose
output.  Finally, I've made it possible to run the test stand-alone in
verbose mode by passing -v as a command line argument.

Now, the test will report failure related to zfill.  That's not my
fault, that's a legitimate problem: the string_tests.py file contains
a test for the zfill() method (just added) but this method is not
implemented.  The responsible party will surely fix this soon now.
2002-04-12 16:25:39 +00:00
Guido van Rossum e027d9818f Add Raymond Hettinger's d.pop(). See SF patch 539949. 2002-04-12 15:11:59 +00:00
Fred Drake 04a8da5cdb Clean up the "all" support for -u. 2002-04-11 20:58:54 +00:00
Tim Peters a7c2b303d4 Since xmllib is deprecated now, suppress the DeprecationWarning its test
module necessarily raises.
2002-04-11 20:18:40 +00:00
Tim Peters b05cd496df Ignore more deprecation warnings. 2002-04-11 20:04:12 +00:00
Tim Peters 3c14efe696 Stop sucking up xmllib -- it's deprecated. 2002-04-11 19:54:11 +00:00
Tim Peters deb121aec7 I don't expect test_email_codecs to run on Windows. 2002-04-11 19:52:58 +00:00
Fred Drake 3a15dace36 Added the resource name "all" to enable all of the optional resource uses.
This is nice for use with "make TESTOPTS='-u all' test".
2002-04-11 16:39:16 +00:00
Fred Drake 43735da1bf Improve coverage of Objects/weakrefobject.c. 2002-04-11 03:59:42 +00:00
Barry Warsaw 409a4c08b5 Sync'ing with standalone email package 2.0.1. This adds support for
non-us-ascii character sets in headers and bodies.  Some API changes
(with DeprecationWarnings for the old APIs).  Better RFC-compliant
implementations of base64 and quoted-printable.

Updated test cases.  Documentation updates to follow (after I finish
writing them ;).
2002-04-10 21:01:31 +00:00
Marc-André Lemburg ce0b664af2 Added test case for UTF-8 encoding bug #541828. 2002-04-10 17:18:02 +00:00
Andrew M. Kuchling a9745611de Use random instead of whrandom 2002-04-10 14:54:39 +00:00
Guido van Rossum 8ace1ab53a - Changed new-style class instantiation so that when C's __new__
method returns something that's not a C instance, its __init__ is
  not called.  [SF bug #537450]
2002-04-06 01:05:01 +00:00