summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #22836: Keep exception reports sensible despite errorsMartin Panter2016-02-281-4/+65
|
* Avoid deprecation warnings.Serhiy Storchaka2015-01-311-1/+1
|
* make sure to test UnicodeEncodeError, tooBenjamin Peterson2014-04-021-1/+1
|
* bail in unicode error's __str__ methods if the objects are not properly ↵Benjamin Peterson2014-04-021-0/+6
| | | | initialized (closes #21134)
* Issue #16445: Fix potential segmentation fault when deleting an exception ↵Mark Dickinson2013-03-031-0/+12
| | | | message.
* add a test for an assertion with tuple msgBenjamin Peterson2011-10-271-0/+6
|
* port 8d05f697acd4 (#11627)Benjamin Peterson2011-07-151-0/+8
|
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-14/+14
| | | | | | | | | | 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. ........
* testcapi tests are definitely cpython onlyBenjamin Peterson2010-06-281-1/+3
|
* Replace catch_warnings with check_warnings when it makes sense. Use ↵Florent Xicluna2010-03-311-14/+9
| | | | assertRaises context manager to simplify some tests.
* Issue #7309: Unchecked pointer access when converting UnicodeEncodeError, ↵Eric Smith2010-02-241-0/+37
| | | | UnicodeDecodeError, and UnicodeTranslateError to strings.
* #7092: Silence py3k warnings in test_exceptions and test_pep352. Patch by ↵Ezio Melotti2010-02-021-34/+35
| | | | Florent Xicluna.
* use assert[Not]In where appropriateEzio Melotti2010-01-231-1/+1
|
* DeprecationWarning is now silent by default.Brett Cannon2010-01-101-0/+1
| | | | | | | | | | | | This was originally suggested by Guido, discussed on the stdlib-sig mailing list, and given the OK by Guido directly to me. What this change essentially means is that Python has taken a policy of silencing warnings that are only of interest to developers by default. This should prevent users from seeing warnings which are triggered by an application being run against a new interpreter before the app developer has a chance to update their code. Closes issue #7319. Thanks to Antoine Pitrou, Ezio Melotti, and Brian Curtin for helping with the issue.
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-39/+35
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-35/+39
| | | | Patch by flox
* #7033: add new API function PyErr_NewExceptionWithDoc, for easily giving new ↵Georg Brandl2009-12-281-0/+39
| | | | exceptions a docstring.
* #6108: unicode(exception) and str(exception) should return the same messageEzio Melotti2009-12-241-1/+109
|
* #6844: do not emit DeprecationWarnings on access if Exception.message has ↵Georg Brandl2009-09-161-0/+40
| | | | | | been set by the user. This works by always setting it in __dict__, except when it's implicitly set in __init__.
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-14/+14
|
* warnings.catch_warnings() now returns a list or None instead of the customBrett Cannon2008-09-091-3/+3
| | | | | | | | WarningsRecorder object. This makes the API simpler to use as no special object must be learned. Closes issue 3781. Review by Benjamin Peterson.
* Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as toAntoine Pitrou2008-08-261-6/+26
| | | | | | | | | | match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__ mechanism. In the process, fix a bug where isinstance() and issubclass(), when given a tuple of classes as second argument, were looking up __instancecheck__ / __subclasscheck__ on the tuple rather than on each type object. Reviewed by Benjamin Peterson and Raymond Hettinger.
* Remove a dummy test that was checked in by mistakeAmaury Forgeot d'Arc2008-07-311-8/+0
|
* #2542: now that issubclass() may call arbitrary code,Amaury Forgeot d'Arc2008-07-311-1/+34
| | | | make sure that PyErr_ExceptionMatches returns 0 when an exception occurs there.
* Issue 2517: Allow unicode messages in Exceptions again by correctly ↵Nick Coghlan2008-07-081-0/+1
| | | | bypassing the instance dictionary when looking up __unicode__ on new-style classes
* Add a missing quotation mark.Brett Cannon2007-11-031-1/+1
|
* Revert accidental checkins from last commit.Georg Brandl2007-08-211-16/+1
|
* Demand version 2.5.1 since 2.5 has a bug with codecs.open context managers.Georg Brandl2007-08-211-1/+16
|
* Remove test.test_support.guard_warnings_filter.Brett Cannon2007-08-141-2/+2
| | | | | | | | test.test_support.catch_warning is more full-featured and provides the same functionality. Since guard_warnings_filter was added in 2.6 there is no backwards-compatibility issues.
* Deprecate BaseException.message as per PEP 352.Brett Cannon2007-05-051-27/+31
|
* Add a test for instantiating SyntaxError with no arguments.Brett Cannon2007-02-281-0/+3
|
* Add a test for slicing an exception.Brett Cannon2007-01-291-0/+7
|
* Remove unneeded imports of 'warnings'.Brett Cannon2006-12-131-1/+0
|
* WindowsError.str should display the windows error code,Thomas Heller2006-10-271-0/+13
| | | | | | | not the posix error code; with test. Fixes #1576174. Will backport to release25-maint.
* Bug #1566800: make sure that EnvironmentError can be called with anyGeorg Brandl2006-09-301-3/+8
| | | | number of arguments, as was the case in Python 2.4.
* Remove the __unicode__ method from exceptions. Allows unicode() to be calledBrett Cannon2006-09-091-0/+9
| | | | | | | on exception classes. Would require introducing a tp_unicode slot to make it work otherwise. Fixes bug #1551432 and will be backported.
* Bug #1542051: Exceptions now correctly call PyObject_GC_UnTrack.Georg Brandl2006-09-061-26/+13
| | | | | Also make sure that every exception class has __module__ set to 'exceptions'.
* Fix for an obscure bug introduced by revs 46806 and 46808, with a test.Armin Rigo2006-06-211-0/+12
| | | | | | | | | | | | | | The problem of checking too eagerly for recursive calls is the following: if a RuntimeError is caused by recursion, and if code needs to normalize it immediately (as in the 2nd test), then PyErr_NormalizeException() needs a call to the RuntimeError class to instantiate it, and this hits the recursion limit again... causing PyErr_NormalizeException() to never finish. Moved this particular recursion check to slot_tp_call(), which is not involved in instantiating built-in exceptions. Backport candidate.
* SF patch 1501987: Remove randomness from test_exceptions,Tim Peters2006-06-071-19/+30
| | | | | | | | | | | | | | | | | | from ?iga Seilnacht (sorry about the name, but Firefox on my box can't display the first character of the name -- the SF "Unix name" is zseil). This appears to cure the oddball intermittent leaks across runs when running test_exceptions under -R. I'm not sure why, but I'm too sleepy to care ;-) The thrust of the SF patch was to remove randomness in the pickle protocol used. I changed the patch to use range(pickle.HIGHEST_PROTOCOL + 1), to try both pickle and cPickle, and randomly mucked with other test lines to put statements on their own lines. Not a bugfix candidate (this is fiddling new-in-2.5 code).
* Fix memory leak found by valgrind.Neal Norwitz2006-06-021-2/+4
|
* Convert docstrings to comments so regrtest -v prints method namesNeal Norwitz2006-06-021-7/+7
|
* Some code style tweaks, and remove apply.Georg Brandl2006-06-011-63/+67
|
* Whitespace normalization.Tim Peters2006-05-301-4/+4
|
* Convert test_exceptions to unittest.Georg Brandl2006-05-301-297/+287
|
* Do the check for no keyword arguments in __init__ so thatGeorg Brandl2006-05-301-1/+1
| | | | subclasses of Exception can be supplied keyword args
* Disallow keyword args for exceptions.Georg Brandl2006-05-301-0/+7
|
* Add a test case for exception pickling. args is never NULL.Georg Brandl2006-05-301-0/+13
|
* Conversion of exceptions over from faked-up classes to new-style C types.Richard Jones2006-05-271-8/+85
|
* PEP 352 implementation. Creates a new base class, BaseException, which has anBrett Cannon2006-03-011-4/+1
| | | | | | | | | added message attribute compared to the previous version of Exception. It is also a new-style class, making all exceptions now new-style. KeyboardInterrupt and SystemExit inherit from BaseException directly. String exceptions now raise DeprecationWarning. Applies patch 1104669, and closes bugs 1012952 and 518846.
* Stop producing or using OverflowWarning. PEP 237 thought this wouldTim Peters2004-08-251-7/+8
| | | | | | | happen in 2.3, but nobody noticed it still was getting generated (the warning was disabled by default). OverflowWarning and PyExc_OverflowWarning should be removed for 2.5, and left notes all over saying so.