Commit Graph

15 Commits

Author SHA1 Message Date
Ezio Melotti 1f517e1d53 #7092: Silence py3k warnings in test_exceptions and test_pep352. Patch by Florent Xicluna. 2010-02-02 17:34:37 +00:00
Ezio Melotti aa98058cc4 use assert[Not]In where appropriate 2010-01-23 23:04:36 +00:00
Senthil Kumaran ce8e33a095 Reverting the Revision: 77368. I committed Flox's big patch for tests by
mistake. ( It may come in for sure tough)
2010-01-08 19:04:16 +00:00
Senthil Kumaran 3ddc435af6 Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. Patch by flox 2010-01-08 18:41:40 +00:00
Georg Brandl ebf3adc4fe #6844 followup: the warning when setting Exception.message was removed, do not test for it. 2009-09-17 11:48:31 +00:00
Benjamin Peterson 5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Georg Brandl 19e79f79ce Avoid PendingDeprecationWarnings emitted by deprecated unittest methods. 2009-06-03 23:23:45 +00:00
Brett Cannon 672237dc6c warnings.catch_warnings() now returns a list or None instead of the custom
WarningsRecorder object. This makes the API simpler to use as no special object
must be learned.

Closes issue 3781.
Review by Benjamin Peterson.
2008-09-09 00:49:16 +00:00
Brett Cannon 2ee4128e9b Remove test.test_support.guard_warnings_filter.
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.
2007-08-14 05:51:06 +00:00
Brett Cannon 229cee2d3d Deprecate BaseException.message as per PEP 352. 2007-05-05 01:34:02 +00:00
Brett Cannon 6fbb96e69a Refactor PEP 352 tests to make it easier in the future to make sure certain
things cannot be raised or caught.
2007-02-23 14:28:25 +00:00
Brett Cannon 129bd52146 No more raising of string exceptions!
The next step of PEP 352 (for 2.6) causes raising a string exception to trigger
a TypeError.  Trying to catch a string exception raises a DeprecationWarning.
References to string exceptions has been removed from the docs since they are
now just an error.
2007-01-30 21:34:36 +00:00
Brett Cannon ca2ca79d23 Remove the __unicode__ method from exceptions. Allows unicode() to be called
on exception classes.  Would require introducing a tp_unicode slot to make it
work otherwise.

Fixes bug #1551432 and will be backported.
2006-09-09 07:11:46 +00:00
Brett Cannon 6b4ed74791 Fix parsing of exception_hierarchy.txt when a platform-specific exception is
specified.  Hopefully this wll bring warming to Tim's Windows-loving heart.
2006-03-01 06:10:48 +00:00
Brett Cannon bf36409e2a PEP 352 implementation. Creates a new base class, BaseException, which has an
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.
2006-03-01 04:25:17 +00:00