Commit Graph

2687 Commits

Author SHA1 Message Date
Walter Dörwald b27cca6634 Check both __div__ and __truediv__ in division tests.
(From SF patch #543867)
2003-08-05 15:34:34 +00:00
Martin v. Löwis 0d8e16c7ad Support trailing dots in DNS names. Fixes #782510. Will backport to 2.3. 2003-08-05 06:19:47 +00:00
Martin v. Löwis 8db4403a76 Correct URL of normalization file. Fixes #781065. Will backport to 2.3. 2003-08-05 05:59:13 +00:00
Brett Cannon 474335ce17 Re-introduce caching of TimeRE and compiled regexes with added thread-safety.
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.
2003-08-05 04:02:49 +00:00
Skip Montanaro ed9bf12848 protect against test problems with Jython 2003-08-03 23:30:40 +00:00
Skip Montanaro d5cf0b86df added test for bug 782369 2003-08-03 23:02:10 +00:00
Skip Montanaro c1b4154587 more extension marshal tests and conversion to unittest - was surprised to
see how much of the file was not covered by the build process
2003-08-02 15:02:33 +00:00
Raymond Hettinger eaef615116 As discussed on python-dev, changed builtin.zip() to handle zero arguments
by returning an empty list instead of raising a TypeError.
2003-08-02 07:42:57 +00:00
Brett Cannon 175ddb5b30 Remove caching of TimeRE (and thus LocaleTime) instance. Error was being
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).
2003-07-24 06:27:17 +00:00
Tim Peters 5943b4ac10 Restored commented-out line checked in by mistake. 2003-07-23 00:30:39 +00:00
Tim Peters 9390dd5b4a locale-restoration code: Don't leave comparison to None implicit. For
all I know, the original locale may be '' (I don't think that's possible,
but ...), and if so we would certainly want to restore it.
2003-07-23 00:30:11 +00:00
Tim Peters 36f7e938f2 Fred wasn't kidding -- there really are docs for the locale module <wink>.
Obtain the original locale in the documented way.  This way actually
works for me.

Restore the original locale at the end, instead of forcing to "C".

Move the locale fiddling into the test driver instead of doing it as a
side effect of merely importing the module.  I don't know why the test
is mucking with locale (and also added a comment saying so), but it
surely has no justification for doing that as an import side-effect.
Now whenever the locale-changing code executes, the locale-restoring code
will also get run.
2003-07-23 00:05:07 +00:00
Brett Cannon d1deac06e7 Fix error in test of not comparing against 0 item of a list 2003-07-22 21:07:16 +00:00
Jason Tishler c23f39ca9d Patch #775784: YA Cygwin expected regression test skip patch
This patch just adds test_ioctl to the list of expected skips for Cygwin.
2003-07-22 18:35:58 +00:00
Thomas Heller 354e3d90d3 Change the zipimport implementation to accept files containing
arbitrary bytes before the actual zip compatible archive.  Zipfiles
containing comments at the end of the file are still not supported.

Add a testcase to test_zipimport, and update NEWS.

This closes sf #775637 and sf #669036.
2003-07-22 18:10:15 +00:00
Jeremy Hylton 969a7003f9 Make sure mimetypes is reinitialized before running the tests.
If some other test comes along and uses mimetypes, it will be
initialized from the system files.
2003-07-18 15:13:37 +00:00
Jeremy Hylton 096d986f3b Restore the locale to "C" on exit.
If this doesn't happen, it leaves the locale in a state that can cause
other tests to fail.  For example, running test_strptime,
test_logging, and test_time in that order.
2003-07-18 03:19:20 +00:00
Jeremy Hylton bd9f520907 Reflow long line. 2003-07-17 16:31:00 +00:00
Raymond Hettinger 43d790c087 Exercise Jim Fulton's new doctest extension for running doctests in a
unittest environment.  Since his extension finds docstrings in private
functions, it exposed a bug in the difflib doctests.
2003-07-16 04:34:56 +00:00
Raymond Hettinger f3590623e9 Extend last change to cover TestSuites as well as TestCases. 2003-07-16 04:29:42 +00:00
Mark Hammond bb4a47c818 Prevent failure on the mac, where "mbcs" is not the file system
encoding.  Use sys.getfilesystemencoding().
2003-07-16 03:46:38 +00:00
Raymond Hettinger 21d9987cb5 run_unittest() to support TestCase instances as well as classes. Helps with doctests. 2003-07-16 02:59:32 +00:00
Raymond Hettinger 19db13bcc7 Fixed test and converted to unittest format.
Checking // would call floor division but did not test that
true division had become the default with 'from __future__ import division'.
2003-07-15 21:03:13 +00:00
Raymond Hettinger 158af581ae Fixed test and converted to unittest format.
Checking // would call floor division but did not test that
true division had become the default with 'from __future__ import division'.
2003-07-15 20:57:35 +00:00
Jeremy Hylton 42d90161e2 SF patch 763201: handling of SyntaxErrors in symbol table build
Bug fix candidate.
2003-07-15 20:24:27 +00:00
Walter Dörwald f393fc6e51 Add various test cases from SF patch 543867. 2003-07-15 18:47:27 +00:00
Fred Drake f425b1ec42 stylistic nits:
- wrap some long lines
- shorten others
- fix indentation
2003-07-14 21:37:17 +00:00
Tim Peters 7a6c733c3b Make close() identical to __del__() for a dumbdbm database. Make
closing idempotent (it used to raise a nuisance exception on the 2nd
close attempt).

Bugfix candidate?  Probably, but arguable.
2003-07-13 17:21:10 +00:00
Raymond Hettinger d6f6e50c9b Reworked test_warnings.py:
* It ran fine under "python regrtest.py test_warnings" but failed under
  "python regrtest.py" presumably because other tests would add to
  filtered warnings and not reset them at the end of the test.

* Converted to a unittest format for better control.  Renamed
  monkey() and unmonkey() to setUp() and tearDown().

* Increased coverage by testing all warnings in __builtin__.

* Increased coverage by testing regex matching of specific messages.
2003-07-13 08:37:40 +00:00
Raymond Hettinger dc9dcf135e This test failed on WindowsME because the full file path did not get
reported consistently with the *nix world.  'Lib/test/test_warnings.py'
came out as 'lib\test\test_warnings.py'.  The basename is all we care
about so I used that.
2003-07-13 06:15:11 +00:00
Jeremy Hylton b6d2f3e07d Don't include slash in search string; it's OS-specific. 2003-07-11 20:22:55 +00:00
Jeremy Hylton 8501466c7f Change warnings to avoid importing re module during startup.
Add API function simplefilter() that does not create or install
regular expressions to match message or module.  Extend the filters
data structure to store None as an alternative to re.compile("").

Move the _test() function to test_warnings and add some code to try
and avoid disturbing the global state of the warnings module.
2003-07-11 15:37:59 +00:00
Tim Peters 663d1b61cb Added a new randomized test. 2003-07-11 04:09:09 +00:00
Jeremy Hylton 121d34af19 Fix SF bug 764095: Don't use network in test_httplib. 2003-07-08 12:36:58 +00:00
Tim Peters e5e065b669 New function sys.getcheckinterval(), to complement setcheckinterval(). 2003-07-06 18:36:54 +00:00
Brett Cannon cde2200ff2 Fixes bug of timezone value being left as -1 when ``time.tzname[0] ==
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.
2003-07-03 19:59:57 +00:00
Just van Rossum 12723bacea Fix and test for bug #764548:
Use isinstance() instead of comparing types directly, to enable
subclasses of str and unicode to be used as patterns.
Blessed by /F.
2003-07-02 20:03:04 +00:00
Just van Rossum 6802c6e764 fixed typo in comment 2003-07-02 14:36:59 +00:00
Andrew MacIntyre 348c261fe6 On those systems lacking the AFMT_S16_NE symbol, the test was failing
because it was still looking in the ossaudiodev module namespace for
this symbol.

As the symbol has already been rebound as a global, use that instead.
2003-07-02 14:05:08 +00:00
Just van Rossum bcc58e87e8 - added (c)StringIO tests; cStringIO usage failed in the previous
version of plistlib.py (r1.2)
2003-07-01 20:22:30 +00:00
Neal Norwitz e7dfe21bed Fix SF bug #763023, difflib.py: ratio() zero division not caught
Backport candidate
2003-07-01 14:59:46 +00:00
Tim Peters 37ca8c12dc connector(): You can't use an empty string as an argument to connect()
on Windows.
2003-07-01 14:49:32 +00:00
Neal Norwitz 1787a0b1cc Fix SF bug #763770, test_socket_ssl crash
Don't run any tests if there is no ssl support.
2003-07-01 13:44:28 +00:00
Raymond Hettinger cc0a664669 Test Brett's addition of __all__ to Queue. 2003-07-01 05:49:02 +00:00
Neal Norwitz 168e73d25e Fix SF #763362, test_posixpath failed
Don't check expanduser('~') if the home directory == the root directory
(ie, we are running as root).
2003-07-01 03:33:31 +00:00
Neal Norwitz 3106817c68 Fix typo in error message 2003-06-30 19:22:12 +00:00
Walter Dörwald 8bcbe6aa7e Don't require that a RuntimeError is raised when playing a second
sound while the first one is still running, as the first one
one might already have finished.

Fixes part of SF bug #763052.
2003-06-30 11:57:52 +00:00
Raymond Hettinger d693a81595 Fix SF 762891: "del p[key]" on proxy object raises SystemError() 2003-06-30 04:18:48 +00:00
Neal Norwitz a9002f824b Fix SF #754870, SSL crash interpreter when remote side closes during connect
Also fix a memory leak.
2003-06-30 03:25:20 +00:00
Raymond Hettinger 0242070d04 More tests
* Test with infinite inputs (using take() on the output)
* Test whether GC can find and eliminate cycles.
2003-06-29 20:36:23 +00:00