Commit Graph

12948 Commits

Author SHA1 Message Date
Fred Drake 449651558c stupid, stupid, stupid! 2008-04-04 11:38:51 +00:00
Fred Drake fe7056240b my previous change did what I said it should not: it changed the current
directory to the directory in which the setup.py script lived (which made
__file__ wrong)

fixed, with test that the script is run in the current directory of the caller
2008-04-04 11:31:14 +00:00
Thomas Heller 8e8ba151dd Issue #2543: Make ctypes compatible (again) with Python 2.3, 2.4, and 2.5. 2008-04-04 08:35:44 +00:00
Fred Drake 46c58c17f1 - Issue #2385: distutils.core.run_script() makes __file__ available, so the
controlled environment will more closely mirror the typical script
  environment.  This supports setup.py scripts that refer to data files.
2008-04-04 05:41:30 +00:00
Jeffrey Yasskin 2b860db35c Doh! os.read() raises an OSError, not an IOError when it's interrupted.
And fix some flakiness in test_itimer_prof, which could detect that the timer
had reached 0 before the signal arrived announcing that fact.
2008-04-04 04:51:19 +00:00
Amaury Forgeot d'Arc d7a265129c #1733757: the interpreter would hang on shutdown, if the function set by 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.
2008-04-03 23:07:55 +00:00
Barry Warsaw 9649cdd5d4 Updating for 2.6a2 2008-04-03 04:10:02 +00:00
Amaury Forgeot d'Arc f7cf388c31 Remove debug prints; the buildbot now passes the tests 2008-04-02 21:18:46 +00:00
Vinay Sajip e5aefa0b30 Fix: #2315, #2316, #2317: TimedRotatingFileHandler - changed logic to better handle daylight savings time, deletion of old log files, and fixed a bug in calculating rollover when no logging occurs for a longer interval than the rollover period. 2008-04-02 21:09:27 +00:00
Neal Norwitz d0a91afa70 Apply same patch from 3k branch to try and prevent this test from hanging
on various platforms, most recently the Alpha Tru64.
2008-04-02 05:54:27 +00:00
Jeffrey Yasskin ab56131720 Try to make test_signal less flaky. I still see some flakiness in
test_itimer_prof.
2008-04-02 04:07:44 +00:00
Amaury Forgeot d'Arc cb0f2ad0c2 A DocTestSuite cannot run multiple times: it clears its globals dictionary after the first run.
Rebuild the DocTestSuite on each iteration.
2008-04-02 00:55:04 +00:00
Amaury Forgeot d'Arc 4d0c1170ef Correct the apparent refleak in test_io:
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.
2008-04-02 00:25:14 +00:00
Amaury Forgeot d'Arc f0a49708eb Newly enabled test appears to leak:
it registers the same codec on each iteration.
Do it only once at load time.
2008-04-01 22:52:48 +00:00
Amaury Forgeot d'Arc ce6f6c12c6 Fix and enable a skipped test:
with python 2.6, enumerating bytes yields 1-char strings, not numbers.

Don't merge this into the py3k branch.
2008-04-01 22:37:33 +00:00
Brett Cannon 8820f2a979 Add ``if __name__ == '__main__'`` to some test files where it didn't take a lot
of effort to do so.
2008-04-01 12:46:02 +00:00
Brett Cannon 8d2a90af2d Generalize test.test_support.test_stdout() with a base context manager so that
it is easy to capture stderr if desired.
2008-04-01 12:37:43 +00:00
Neal Norwitz d48a2f77f0 Be sure to close the file. 2 places were deleting the file, so it was probably
fine, but the last change may be required for the test to pass on Windows.
Should we always close the mmap too?
2008-04-01 05:40:43 +00:00
Martin v. Löwis affbe80a54 Merged revisions 61990-62079 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r62017 | david.wolever | 2008-03-28 21:54:37 +0100 (Fr, 28 Mär 2008) | 1 line

  Fixed an out-of-date comment.
........
2008-03-31 05:20:55 +00:00
Jeffrey Yasskin 105f3d4fdc Block the sys.exc_clear -3 warning from threading.py. 2008-03-31 00:35:53 +00:00
Georg Brandl e34c21c2a0 Make AST nodes pickleable. 2008-03-30 20:20:39 +00:00
Georg Brandl 2c55c597fa Make _fields attr for no fields consistent with _attributes attr. 2008-03-30 19:00:49 +00:00
Georg Brandl ebc8dedd19 Convert test_ast to unittest and add a test for r62049. 2008-03-30 07:09:22 +00:00
Georg Brandl c87c5800e7 Adapt test_ast to the new ExceptHandler type. 2008-03-30 06:53:55 +00:00
Benjamin Peterson 5b63acd31e #2503 make singletons compared with "is" not == or !=
Thanks to Wummel for the patch
2008-03-29 15:24:25 +00:00
Amaury Forgeot d'Arc 672fbf5195 Still investigating on the hanging test_socket.
the test itself doesn't do anything on windows, focus on setUp and tearDown.
2008-03-29 14:53:05 +00:00
Amaury Forgeot d'Arc 5e08e8b15c The buildbot "x86 W2k8 trunk" seems to hang in test_socket.
http://www.python.org/dev/buildbot/trunk/x86%20W2k8%20trunk/builds/255/step-test/0

Temporarily increase verbosity of this test.
2008-03-29 13:47:05 +00:00
Georg Brandl f2bfd54d6f Properly check for consistency with the third argument of
compile() when compiling an AST node.
2008-03-29 13:24:23 +00:00
Amaury Forgeot d'Arc ea13dc629c Now that Lib/test/output is gone, tests should not print anything,
except in verbose mode.
Support code is much simpler.
2008-03-29 13:14:52 +00:00
Amaury Forgeot d'Arc bae17a8aa1 lib2to3 should install a logging handler only when run as a main program,
not when used as a library.

This may please the buildbots, which fail when test_lib2to3 is run before test_logging.
2008-03-29 12:42:54 +00:00
Amaury Forgeot d'Arc 2aece57d7f Correctly call the base class tearDown();
otherwise running test_logging twice produce the errors we see on all buildbots
2008-03-29 01:42:31 +00:00
Amaury Forgeot d'Arc 504a48f90a Revert my experiment. I found one reason of failures in test_logging. 2008-03-29 01:41:08 +00:00
Amaury Forgeot d'Arc 554d4f0c13 At least let the module compile 2008-03-29 00:49:07 +00:00
Amaury Forgeot d'Arc 8a69707b80 Try to understand why most buildbots suddenly turned to red.
Undo the only change that might have unexpected effects.

To be followed.
2008-03-29 00:44:58 +00:00
Benjamin Peterson 41cf50d613 #2498 modernized try, except, finally statements in bdb 2008-03-28 20:56:00 +00:00
Gregory P. Smith a98be45f18 These svn adds were forgotten in r62000 2008-03-28 20:11:49 +00:00
Gerhard Häring 2a11c05b9d Update sqlite3 module to match current version of pysqlite. 2008-03-28 20:08:36 +00:00
Georg Brandl fc8eef3c78 Patch #1810 by Thomas Lee, reviewed by myself:
allow compiling Python AST objects into code objects
in compile().
2008-03-28 12:11:56 +00:00
Gregory P. Smith b9803421d2 Accept patch issue2426 by Paul Kippes (kippesp).
Adds sqlite3.Connection.iterdump to allow dumping of databases.
2008-03-28 08:32:09 +00:00
Gregory P. Smith 0001c2ecbc This patch moves some tests from test_urllib2_net to test_urllib2_localnet.
The moved tests use a local server rather than going out to external servers.

Accepts patch from issue2429.

Contributed by Jerry Seutter & Michael Foord (fuzzyman) at PyCon 2008.
2008-03-28 08:00:44 +00:00
Neal Norwitz ab364c4366 Name the main method correctly so the test is run 2008-03-28 07:36:31 +00:00
Neal Norwitz 70cea58c84 Bug 1503: Get the test to pass on OSX. This should make the test more
reliable, but I'm not convinced it is the right solution.  We need
to determine if this causes the test to hang on any platforms or do
other bad things.

Even if it gets the test to pass reliably, it might be that we want
to fix this in socket.  The socket returned from accept() is different
on different platforms (inheriting attributes or not) and we might
want to ensure that the attributes (at least blocking) is the same
across all platforms.
2008-03-28 06:34:03 +00:00
Martin v. Löwis 85a896902c Merged revisions 61825-61989 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r61899 | collin.winter | 2008-03-25 17:53:41 +0100 (Di, 25 Mär 2008) | 1 line

  Add a missing explicit fixer to test_all_fixers.
........
  r61983 | collin.winter | 2008-03-28 03:19:46 +0100 (Fr, 28 Mär 2008) | 2 lines

  Fix http://bugs.python.org/issue2453: support empty excepts in fix_except.
........
2008-03-28 05:27:44 +00:00
Martin v. Löwis 53dbcd33a9 Run 2to3 tests. 2008-03-28 05:26:10 +00:00
Martin v. Löwis fac4f095c1 Disable test that depends on #2412 being fixed. 2008-03-28 05:25:36 +00:00
Jeffrey Yasskin 36550bdde9 Print more information the next time test_socket throws the wrong exception. 2008-03-28 04:53:10 +00:00
Neal Norwitz 023cd00ccc Allow use of other ports so the test can pass if 9091 is in use 2008-03-28 04:41:34 +00:00
Jeffrey Yasskin 8b9091fba0 Kill a race in test_threading in which the exception info in a thread finishing
up after it was joined had a traceback pointing to that thread's (deleted)
target attribute, while the test was trying to check that the target was
destroyed. Big thanks to Antoine Pitrou for diagnosing the race and pointing
out sys.exc_clear() to kill the exception early. This fixes issue 2496.
2008-03-28 04:11:18 +00:00
Amaury Forgeot d'Arc 7db15fe9d9 test_future3.py is a regular test file, and should be part of the test suite 2008-03-28 00:21:34 +00:00
Amaury Forgeot d'Arc da0c025a43 Issue2495: tokenize.untokenize did not insert space between two consecutive string literals:
"" "" => """", which is invalid code.

Will backport
2008-03-27 23:23:54 +00:00