Commit Graph

12743 Commits

Author SHA1 Message Date
Christian Heimes 608c1d8e87 Since abc._Abstract was replaces by a new type flags the regression test suite fails. I've added a new function inspect.isabstract(). Is the mmethod fine or should I check if object is a instance of type or subclass of object, too? 2008-03-03 18:28:04 +00:00
Brett Cannon 7dbd91811d Add test_main() functions to various tests where it was simple to do. Done so
that regrtest can execute the test_main() directly instead of relying on import
side-effects.
2008-03-03 04:19:29 +00:00
Brett Cannon 963c80fd45 Add a note in the main test class' docstring that the order of execution of the
tests is important.
2008-03-03 03:26:43 +00:00
Brett Cannon bfbf5b3715 Add a note in the main test class' docstring that the order of execution of the
tests is important.
2008-03-03 03:24:48 +00:00
Brett Cannon 6382ffc892 Move test_largefile over to using 'with' statements for open files.
Also rename the driver function to test_main() instead of main_test().
2008-03-03 02:41:40 +00:00
Brett Cannon 56c4debe0d Refactor test_logging to use unittest. This should finally solve the flakiness
issues.

Thanks to Antoine Pitrou for the patch.
2008-03-03 00:38:58 +00:00
Gregory P. Smith 492e2bfefa Modify import of test_support so that the code can also be used with a
stand alone distribution of bsddb that includes its own small copy of
test_support for the needed functionality on older pythons.
2008-03-02 20:00:53 +00:00
Gerhard Häring f40f6846e3 Made sqlite3 module's regression tests work with SQLite versions that don't
support "create table if not exists", yet.
2008-03-02 13:08:03 +00:00
Barry Warsaw 9d225e63be Give IDLE a release date 2008-03-01 03:00:52 +00:00
Barry Warsaw c853f5d4dc bump idle version number 2008-03-01 02:26:42 +00:00
Gerhard Häring 1cc60ed214 Updated to pysqlite 2.4.1. Documentation additions will come later. 2008-02-29 22:08:41 +00:00
Mark Dickinson f4da77765f Fix docstring typo. 2008-02-29 03:29:17 +00:00
Raymond Hettinger 08ff6822cc Handle the repeat keyword argument for itertools.product(). 2008-02-29 02:21:48 +00:00
Mark Dickinson 1ddf1d8482 Add __format__ method to Decimal, to support PEP 3101 2008-02-29 02:16:37 +00:00
Raymond Hettinger b4cbc98c39 Add alternate constructor for itertools.chain(). 2008-02-28 22:46:41 +00:00
Raymond Hettinger 05bf6338b8 Have itertools.chain() consume its inputs lazily instead of building a tuple of iterators at the outset. 2008-02-28 22:30:42 +00:00
Christian Heimes acfd8ed0cd Windows fix for signal test - skip it earlier 2008-02-28 21:00:45 +00:00
Jeffrey Yasskin 392c159ad6 Prevent SocketServer.ForkingMixIn from waiting on child processes that it
didn't create, in most cases. When there are max_children handlers running, it
will still wait for any child process, not just handler processes.
2008-02-28 18:03:15 +00:00
Andrew M. Kuchling a6298528e1 #2169: make generated HTML more valid 2008-02-28 14:03:03 +00:00
Jeffrey Yasskin 69e1309fd4 Thread.start() used sleep(0.000001) to make sure it didn't return before the
new thread had started. At least on my MacBook Pro, that wound up sleeping for
a full 10ms (probably 1 jiffy). By using an Event instead, we can be absolutely
certain that the thread has started, and return more quickly (217us).

Before:
$  ./python.exe -m timeit -s 'from threading import Thread'  't = Thread(); t.start(); t.join()'
100 loops, best of 3: 10.3 msec per loop
$  ./python.exe -m timeit -s 'from threading import Thread; t = Thread()'  't.isAlive()'
1000000 loops, best of 3: 0.47 usec per loop

After:
$  ./python.exe -m timeit -s 'from threading import Thread'  't = Thread(); t.start(); t.join()'
1000 loops, best of 3: 217 usec per loop
$  ./python.exe -m timeit -s 'from threading import Thread; t = Thread()'  't.isAlive()'
1000000 loops, best of 3: 0.86 usec per loop

To be fair, the 10ms isn't CPU time, and other threads including the spawned
one get to run during it. There are also some slightly more complicated ways to
get back the .4us in isAlive() if we want.
2008-02-28 06:09:19 +00:00
Jeffrey Yasskin 180997b2bb Speed test_socketserver up from 28.739s to 0.226s, simplify the logic, and make
sure all tests run even if some fail.
2008-02-28 05:53:18 +00:00
Jeffrey Yasskin 960b9b7a2f Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT,
which forbids constructing types that have it set. The effect is to speed

  ./python.exe -m timeit -s 'import abc' -s 'class Foo(object): __metaclass__ = abc.ABCMeta' 'Foo()'

up from 2.5us to 0.201us. This fixes issue 1762.
2008-02-28 04:45:36 +00:00
Raymond Hettinger 2ab0552b5e Larger test range 2008-02-27 01:08:30 +00:00
Raymond Hettinger 93e804da9c Add itertools.combinations(). 2008-02-26 23:40:50 +00:00
Christian Heimes ea837931cf Patch #1691070 from Roger Upole: Speed up PyArg_ParseTupleAndKeywords() and improve error msg
My tests don't show the promised speed up of 10%. The code is as fast as the old code for simple cases and slightly faster for complex cases with several of args and kwargs. But the patch simplifies the code, too.
2008-02-26 17:23:51 +00:00
Neal Norwitz ca37661a69 Add a timing flag to Trace so you can see where slowness occurs
like waiting for socket timeouts in test_smtplib :-).
2008-02-26 08:21:28 +00:00
Neal Norwitz 75992edfae Speed up this test by about 99%. Remove sleeps and replace with events.
(This may fail on some slow platforms, but we can fix those cases which
should be relatively isolated and easier to find now.)
Move two test cases that didn't require a server to be started
to a separate TestCase.  These tests were taking 3 seconds which
is what the timeout was set to.
2008-02-26 08:04:59 +00:00
Neal Norwitz b0917c14f2 Don't use a hard coded port. This test could hang/fail if the port is in use.
Speed this test up by avoiding a sleep and using the event.
2008-02-26 04:50:37 +00:00
Raymond Hettinger 39df66179f Revert part of r60927 which made invalid assumptions about the API offered by db modules. 2008-02-25 23:17:41 +00:00
Raymond Hettinger 9d63837e9b Make sure the itertools filter functions give the same performance for func=bool as func=None. 2008-02-25 22:42:32 +00:00
Facundo Batista 4219da4bd0 Issue 2117. Update compiler module to handle class decorators.
Thanks Thomas Herve
2008-02-25 18:06:00 +00:00
Andrew M. Kuchling 734451a4bc Use file descriptor for real stdout 2008-02-25 16:29:58 +00:00
Andrew M. Kuchling aa5e3cea7a Move .setupterm() output so that we don't try to call endwin() if it fails 2008-02-25 16:29:19 +00:00
Brett Cannon c6b5200931 Fix a minor typo in a docstring. 2008-02-25 05:33:33 +00:00
Neal Norwitz 6057b2e645 Create a db_home directory with a unique name so multiple users can
run the test simultaneously.  The simplest thing I found that worked
on both Windows and Unix was to use the PID.  It's unique so should be
sufficient.  This should prevent many of the spurious failures of
the automated tests since they run as different users.

Also cleanup the directory consistenly in the tearDown methods.

It would be nice if someone ensured that the directories are always
created with a consistent name.
2008-02-24 18:47:03 +00:00
Mark Dickinson 6a123cb782 Remove duplicate 'import re' in decimal.py 2008-02-24 18:12:36 +00:00
Facundo Batista c11cecf3d0 Issue 1742669. Now %d accepts very big float numbers.
Thanks Gabriel Genellina.
2008-02-24 03:17:21 +00:00
Georg Brandl 8c460d5241 #1627: httplib now ignores negative Content-Length headers. 2008-02-24 00:14:24 +00:00
Georg Brandl 2363503074 #900744: If an invalid chunked-encoding header is sent by a server,
httplib will now raise IncompleteRead and close the connection instead
of raising ValueError.
2008-02-24 00:03:22 +00:00
Georg Brandl ebcfd11c16 #1506171: added operator.methodcaller(). 2008-02-23 23:04:35 +00:00
Georg Brandl e2065c65d3 #1826: allow dotted attribute paths in operator.attrgetter. 2008-02-23 23:02:23 +00:00
Facundo Batista c12b9888f7 Added simple test case. Thanks Benjamin Peterson. 2008-02-23 22:54:12 +00:00
Georg Brandl 0bb8567e1e In test_heapq and test_bisect, test both the Python and the C implementation.
Originally written for GHOP by Josip Dzolonga, heavily patched by me.
2008-02-23 22:35:33 +00:00
Georg Brandl 8d01bb2b19 Use os.closerange() in popen2. 2008-02-23 22:09:24 +00:00
Jeffrey Yasskin a885c1521a Followup to r61011: Also avoid the reference cycle when the Thread's target
raises an exception.
2008-02-23 20:40:35 +00:00
Jeffrey Yasskin 3414ea9ed9 Prevent classes like:
class RunSelfFunction(object):
        def __init__(self):
            self.thread = threading.Thread(target=self._run)
            self.thread.start()
        def _run(self):
            pass
from creating a permanent cycle between the object and the thread by having the
Thread delete its references to the object when it completes.

As an example of the effect of this bug, paramiko.Transport inherits from
Thread to avoid it.
2008-02-23 19:40:54 +00:00
Andrew M. Kuchling 1beea27299 #1389051, #1092502: fix excessively large allocations when using read() on a socket 2008-02-23 19:28:58 +00:00
Andrew M. Kuchling 1219a80989 #1389051: IMAP module tries to read entire message in one chunk. Patch by Fredrik Lundh. 2008-02-23 19:02:33 +00:00
Christian Heimes c5f05e45cf Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
Andrew M. Kuchling 19aff0c90a #1433694: minidom's .normalize() failed to set .nextSibling for last element.
Fix by Malte Helmert
2008-02-23 17:10:46 +00:00