summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_with.py
Commit message (Collapse)AuthorAgeFilesLines
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-4/+4
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* normalize exceptions passed to the __exit__ method #7853Benjamin Peterson2010-02-051-1/+0
| | | | | | | | | In Python 2.x, exceptions in finally blocks are not normalized. Since with statements are implemented using finally blocks, ceval.c had to be tweaked to distinguish between with finally blocks and normal ones. A test for the finalization of generators containing with statements was also added.
* add a test for #7853; the exception must be normalized for withBenjamin Peterson2010-02-051-3/+20
|
* #7092: Silence more py3k warnings. Patch by Florent Xicluna.Ezio Melotti2010-02-031-3/+3
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-3/+3
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-3/+3
| | | | Patch by flox
* add missing assertion #6313Benjamin Peterson2009-06-191-0/+1
|
* remove duplicate testBenjamin Peterson2009-06-191-9/+0
|
* Better name for "Ctor".Georg Brandl2009-06-041-2/+2
|
* Allow multiple context managers in one with statement, as proposedGeorg Brandl2009-05-251-1/+77
| | | | | | | in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics.
* #4559: When a context manager's __exit__() method returns an object whoseAmaury Forgeot d'Arc2008-12-101-0/+30
| | | | | | | conversion to bool raises an exception, 'with' loses that exception. Reviewed by Jeffrey Yasskin. Already ported to 2.5, will port to 2.6 and 3.0
* Remove some from __future__ import with_statementsBenjamin Peterson2008-04-301-1/+0
|
* Fix for bug 1705170 - contextmanager swallowing StopIteration (2.5 backport ↵Nick Coghlan2007-11-021-0/+17
| | | | candidate)
* Finish bringing SVN into line with latest version of PEP 343 by getting rid ↵Nick Coghlan2006-05-031-7/+8
| | | | of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
* Get rid of __context__, per the latest changes to PEP 343 and python-devGuido van Rossum2006-05-021-74/+7
| | | | | | | | discussion. There are two places of documentation that still mention __context__: Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without spending a whole lot of time thinking about it; and whatsnew, which Andrew usually likes to change himself.
* Rev 45706 renamed stuff in contextlib.py, but didn't renameTim Peters2006-04-261-8/+8
| | | | | | | | | | | | | | uses of it in test_with.py. As a result, test_with has been skipped (due to failing imports) on all buildbot boxes since. Alas, that's not a test failure -- you have to pay attention to the 1 skip unexpected on PLATFORM: test_with kinds of output at the ends of test runs to notice that this got broken. It's likely that more renaming in test_with.py would be desirable.
* Fix SF#1462485: StopIteration raised in body of 'with' statement suppressedPhillip J. Eby2006-04-031-0/+56
|
* Um, I thought I'd already checked this in.Guido van Rossum2006-03-101-10/+22
| | | | | | | Anyway, this is the changes to the with-statement so that __exit__ must return a true value in order for a pending exception to be ignored. The PEP (343) is already updated.
* Updates to the with-statement:Guido van Rossum2006-02-281-14/+70
| | | | | | | | | | | | | | | | - New semantics for __exit__() -- it must re-raise the exception if type is not None; the with-statement itself doesn't do this. (See the updated PEP for motivation.) - Added context managers to: - file - thread.LockType - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore} - decimal.Context - Added contextlib.py, which defines @contextmanager, nested(), closing(). - Unit tests all around; bot no docs yet.
* from __future__ import with_statement addon for 'with', mostly written byThomas Wouters2006-02-281-0/+2
| | | | Neal.
* Set EOL style to native.Tim Peters2006-02-281-560/+560
|
* Whitespace normalization.Tim Peters2006-02-281-560/+560
|
* PEP 343 -- the with-statement.Guido van Rossum2006-02-271-0/+560
This was started by Mike Bland and completed by Guido (with help from Neal). This still needs a __future__ statement added; Thomas is working on Michael's patch for that aspect. There's a small amount of code cleanup and refactoring in ast.c, compile.c and ceval.c (I fixed the lltrace behavior when EXT_POP is used -- however I had to make lltrace a static global).