summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Comment typoAndrew M. Kuchling2008-04-211-1/+1
|
* Correct an apparent refleak in test_pkgutil: zipimport._zip_directory_cache ↵Amaury Forgeot d'Arc2008-04-201-0/+3
| | | | | | contains info for all processed zip files, even when they are no longer used.
* Add test for tanh(-0.) == -0. on IEEE 754 systemsMark Dickinson2008-04-201-0/+58
|
* Yet more explicit special case handling to makeMark Dickinson2008-04-201-0/+12
| | | | | | math.pow behave on alpha Tru64. All IEEE 754 special values are now handled directly; only the finite**finite case is handled by libm.
* Report additional diagnostic information inMark Dickinson2008-04-201-1/+6
| | | | | test_math, to help track down debian-alpha buildbot failure.
* Additional tests for math.pow, and extra special-caseMark Dickinson2008-04-191-10/+124
| | | | | handling code in math.pow, in the hope of making all tests pass on the alpha Tru64 buildbot.
* Added kill, terminate and send_signal to subprocess.PopenChristian Heimes2008-04-191-0/+46
| | | | The bits and pieces for the Windows side were already in place. The POSIX side is trivial (as usual) and uses os.kill().
* Some tests did not pass on repeated calls (regrtest -R::)Amaury Forgeot d'Arc2008-04-187-9/+29
| | | | Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry.
* I finally got the time to update and merge Mark's and my trunk-math branch. ↵Christian Heimes2008-04-185-30/+3106
| | | | | | The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math. The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :)
* resolve issue 2014Skip Montanaro2008-04-181-0/+11
|
* Add test file missing from rev 62350Nick Coghlan2008-04-151-0/+123
|
* Fix spliting on colons on Windows machines with a file path by limiting theBrett Cannon2008-04-131-3/+1
| | | | number of splits.
* Add an explicit check for output in a test to try to diagnose a failure onBrett Cannon2008-04-131-1/+4
| | | | Windows.
* spellingSkip Montanaro2008-04-131-1/+1
|
* Fix test_warnings by making the state of things more consistent for each testBrett Cannon2008-04-131-29/+42
| | | | when it is run.
* Re-implement the 'warnings' module in C. This allows for usage of theBrett Cannon2008-04-122-84/+344
| | | | | | | | | 'warnings' code in places where it was previously not possible (e.g., the parser). It could also potentially lead to a speed-up in interpreter start-up if the C version of the code (_warnings) is imported over the use of the Python version in key places. Closes issue #1631171.
* Remove the test file before writing it in case there is no write permission.Neal Norwitz2008-04-104-5/+7
| | | | | | This might help fix some of the failures on Windows box(es). It doesn't hurt either way and ensure the tests are a little more self contained (ie have less assumptions).
* better diagnosticsGregory P. Smith2008-04-091-2/+2
|
* Changed test so it no longer runs as a side effect of importing.Jerry Seutter2008-04-091-110/+115
|
* Fix typo with regards to self.PORT shadowing class variables with the same name.Trent Nelson2008-04-092-7/+8
|
* Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.Gregory P. Smith2008-04-091-0/+5
| | | | It tried to allocate negative or zero memory. That fails.
* - Issue #2550: The approach used by client/server code for obtaining portsTrent Nelson2008-04-0812-651/+679
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to listen on in network-oriented tests has been refined in an effort to facilitate running multiple instances of the entire regression test suite in parallel without issue. test_support.bind_port() has been fixed such that it will always return a unique port -- which wasn't always the case with the previous implementation, especially if socket options had been set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT). The new implementation of bind_port() will actually raise an exception if it is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or SO_REUSEPORT socket option set. Furthermore, if available, bind_port() will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed. This currently only applies to Windows. This option prevents any other sockets from binding to the host/port we've bound to, thus removing the possibility of the 'non-deterministic' behaviour, as Microsoft puts it, that occurs when a second SOCK_STREAM socket binds and accepts to a host/port that's already been bound by another socket. The optional preferred port parameter to bind_port() has been removed. Under no circumstances should tests be hard coding ports! test_support.find_unused_port() has also been introduced, which will pass a temporary socket object to bind_port() in order to obtain an unused port. The temporary socket object is then closed and deleted, and the port is returned. This method should only be used for obtaining an unused port in order to pass to an external program (i.e. the -accept [port] argument to openssl's s_server mode) or as a parameter to a server-oriented class that doesn't give you direct access to the underlying socket used. Finally, test_support.HOST has been introduced, which should be used for the host argument of any relevant socket calls (i.e. bind and connect). The following tests were updated to following the new conventions: test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib, test_poplib, test_ftplib, test_telnetlib, test_socketserver, test_asynchat and test_socket_ssl. It is now possible for multiple instances of the regression test suite to run in parallel without issue.
* Issue2564: Prevent a hang in "import test.autotest", which runs the entire testAmaury Forgeot d'Arc2008-04-081-3/+2
| | | | | | | suite as a side-effect of importing the module. - in test_capi, a thread tried to import other modules - re.compile() imported sre_parse again on every call.
* Make file objects as thread safe as the underlying libc FILE* implementation.Gregory P. Smith2008-04-061-1/+167
| | | | | | | | | | | close() will now raise an IOError if any operations on the file object are currently in progress in other threads. Most code was written by Antoine Pitrou (pitrou). Additional testing, documentation and test suite cleanup done by me (gregory.p.smith). Fixes issue 815646 and 595601 (as well as many other bugs and references to this problem dating back to the dawn of Python).
* Add enough debugging information to diagnose failures where theJeffrey Yasskin2008-04-061-5/+14
| | | | | | | | HandlerBException is ignored, and fix one such problem, where it was thrown during the __del__ method of the previous Popen object. We may want to find a better way of printing verbose information so it's not spammy when the test passes.
* Revert r62152 (Issue #2550). Being able to observe the results of all the ↵Trent Nelson2008-04-041-76/+0
| | | | buildbots was certainly useful. All of the platforms that have some form of BSD lineage -- FreeBSD, OS X, Solaris and Tru64 -- all pass the test. Windows and Linux, on the other hand, don't. Windows I knew about, Linux was a surprise. Knowing this, I believe a more appropriate fix will revolve around test_support.bind_socket() -- this method needs to return a port that nothing in the system has bound already. The best way to do this may just be to rely on ephemeral ports, rather than having the user specify a desired port, then fall back to four random ports, then try 0.
* Issue 2550: extend test_socket.py to test SO_REUSEADDR semantics when bind() ↵Trent Nelson2008-04-041-0/+76
| | | | is called on identical (host, port) combinations in two separate sockets. This should raise an EADDRINUSE socket.error in all cases, irrespective of whether or not SO_REUSEADDR is set on the sockets. However, with Windows, when SO_REUSEADDR is set on the sockets, no error is thrown (an error is thrown when the option isn't set), which results in an extremely wedged python process whenever accept() is called on either of the bound sockets. I'm committing this test now to observe if it's only Windows that has this behaviour (via the buildbots). Note: this WILL break all Windows buildbots for now; once I've observed the results on other platforms, I'll revert, then start looking into a patch.
* Oops again. EINTR is in errno, not signal.Jeffrey Yasskin2008-04-041-1/+1
|
* Doh! os.read() raises an OSError, not an IOError when it's interrupted.Jeffrey Yasskin2008-04-041-2/+5
| | | | | And fix some flakiness in test_itimer_prof, which could detect that the timer had reached 0 before the signal arrived announcing that fact.
* #1733757: the interpreter would hang on shutdown, if the function set by ↵Amaury Forgeot d'Arc2008-04-031-0/+29
| | | | | | | | | | | | sys.settrace calls threading.currentThread. The correction somewhat improves the code, but it was close. Many thanks to the "with" construct, which turns python code into C calls. I wonder if it is not better to sys.settrace(None) just after running the __main__ module and before finalization.
* Remove debug prints; the buildbot now passes the testsAmaury Forgeot d'Arc2008-04-021-14/+0
|
* Apply same patch from 3k branch to try and prevent this test from hangingNeal Norwitz2008-04-021-0/+1
| | | | on various platforms, most recently the Alpha Tru64.
* Try to make test_signal less flaky. I still see some flakiness inJeffrey Yasskin2008-04-021-6/+24
| | | | test_itimer_prof.
* A DocTestSuite cannot run multiple times: it clears its globals dictionary ↵Amaury Forgeot d'Arc2008-04-021-3/+2
| | | | | | after the first run. Rebuild the DocTestSuite on each iteration.
* Correct the apparent refleak in test_io:Amaury Forgeot d'Arc2008-04-021-12/+10
| | | | | | | | | | | | | | | When cls is an ABCMeta, every call to isinstance(x, cls) records type(x) in the cls._abc_cache of cls_abc_negative_cache. So we clear these caches at the end of the test. inspect.isabstract() is not the correct test for all ABCs, because there is no @abstractmethod in io.py (why?) isinstance(cls, ABCMeta) would be more exact, but it fails with an infinite recursion. So I used a hack to determine whether a class is an ABCMeta. The true correction would be to turn cls._abc_cache &co into a WeakSet, as py3k does. But classic classes are not weak referenceable... Of course, this change should not be merged into the py3k branch.
* Newly enabled test appears to leak:Amaury Forgeot d'Arc2008-04-011-12/+19
| | | | | it registers the same codec on each iteration. Do it only once at load time.
* Fix and enable a skipped test:Amaury Forgeot d'Arc2008-04-011-5/+4
| | | | | | with python 2.6, enumerating bytes yields 1-char strings, not numbers. Don't merge this into the py3k branch.
* Add ``if __name__ == '__main__'`` to some test files where it didn't take a lotBrett Cannon2008-04-014-18/+36
| | | | of effort to do so.
* Generalize test.test_support.test_stdout() with a base context manager so thatBrett Cannon2008-04-011-7/+11
| | | | it is easy to capture stderr if desired.
* Be sure to close the file. 2 places were deleting the file, so it was probablyNeal Norwitz2008-04-011-1/+3
| | | | | fine, but the last change may be required for the test to pass on Windows. Should we always close the mmap too?
* Make AST nodes pickleable.Georg Brandl2008-03-301-0/+14
|
* Make _fields attr for no fields consistent with _attributes attr.Georg Brandl2008-03-301-0/+3
|
* Convert test_ast to unittest and add a test for r62049.Georg Brandl2008-03-301-34/+61
|
* Adapt test_ast to the new ExceptHandler type.Georg Brandl2008-03-301-1/+2
|
* #2503 make singletons compared with "is" not == or !=Benjamin Peterson2008-03-294-6/+6
| | | | Thanks to Wummel for the patch
* Still investigating on the hanging test_socket.Amaury Forgeot d'Arc2008-03-291-2/+4
| | | | the test itself doesn't do anything on windows, focus on setUp and tearDown.
* The buildbot "x86 W2k8 trunk" seems to hang in test_socket.Amaury Forgeot d'Arc2008-03-291-0/+12
| | | | | | http://www.python.org/dev/buildbot/trunk/x86%20W2k8%20trunk/builds/255/step-test/0 Temporarily increase verbosity of this test.
* Properly check for consistency with the third argument ofGeorg Brandl2008-03-291-0/+14
| | | | compile() when compiling an AST node.
* Now that Lib/test/output is gone, tests should not print anything,Amaury Forgeot d'Arc2008-03-291-63/+19
| | | | | except in verbose mode. Support code is much simpler.
* Correctly call the base class tearDown();Amaury Forgeot d'Arc2008-03-291-0/+1
| | | | otherwise running test_logging twice produce the errors we see on all buildbots