summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] bpo-31285: Fix an assertion failure and a SystemError in ↵Serhiy Storchaka2017-09-271-0/+36
| | | | | warnings.warn_explicit. (GH-3219) (#3775) (cherry picked from commit 91fb0afe181986b48abfc6092dcca912b39de51d)
* [3.6] bpo-31566: Fix an assertion failure in _warnings.warn() in case of a ↵Miss Islington (bot)2017-09-241-0/+10
| | | | | bad __name__ global. (GH-3717) (#3730) (cherry picked from commit 5d3e80021ab33360191eb0fbff34e0246c913884)
* [3.6] bpo-31416: Fix assertion failures in case of a bad warnings.filters or ↵Serhiy Storchaka2017-09-121-0/+15
| | | | | | warnings.defaultaction. (GH-3496) (#3509) Patch by Oren Milman.. (cherry picked from commit 9d984fd2b097c8c29479d1c3eb740995fe1ccb0d)
* [3.6] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry ↵Serhiy Storchaka2017-09-111-0/+11
| | | | | is not a dictionary. (GH-3485). (#3494) (cherry picked from commit 252033d50effa08046ac34fcc406bc99796ab88b)
* bpo-30812: Fix test_warnings, restore _showwarnmsg (#2504) (#2507)Victor Stinner2017-06-301-4/+9
| | | | | bpo-26568, bpo-30812: Fix test_showwarnmsg_missing(): restore the attribute after removing it. (cherry picked from commit 7eebeb8fb84e2a9cb73903a08c59cf1d3b32cee0)
* warnings: Fix the issue numberVictor Stinner2016-12-061-2/+2
| | | | The fix for catch_warnings() is the issue #28835 (not the issue #28089).
* catch_warnings() calls showwarning() if overridenVictor Stinner2016-12-061-0/+45
| | | | | Issue #28089: Fix a regression introduced in warnings.catch_warnings(): call warnings.showwarning() if it was overriden inside the context manager.
* Issue #27528: Merge warning doc and test from 3.5Martin Panter2016-07-191-0/+12
|\
| * Issue #27528: Document and test warning messages must match at beginningMartin Panter2016-07-191-0/+12
| |
* | Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+1
|\ \ | |/
| * Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+1
| |
| * first step in backout of bad default->3.5 merge d085b4f779af. Create new ↵Ned Deily2016-06-031-1/+1
| | | | | | | | head and fix whitespace.
* | Merge 3.5 (test_warnings)Victor Stinner2016-05-261-1/+9
|\ \ | |/
| * test_warnings: catch stderr and check warningVictor Stinner2016-05-261-1/+9
| | | | | | | | | | Check the user warning in test_error_after_default() to not pollute the output, and check the warning logged into stderr.
* | Issue #18383: Merge warnings fix from 3.5Martin Panter2016-05-261-0/+47
|\ \ | |/
| * Issue #18383: Avoid adding duplicate filters when warnings is reloadedMartin Panter2016-05-261-0/+47
| | | | | | | | Based on patch by Alex Shkop.
| * Issue #21925: Fix test_warnings for release modeVictor Stinner2016-03-251-2/+2
| | | | | | | | Use -Wd comment line option to log the ResourceWarning.
* | Issue #21925: Fix test_warnings for release modeVictor Stinner2016-03-251-2/+2
| | | | | | | | Use -Wd comment line option to log the ResourceWarning.
* | Merge 3.5Victor Stinner2016-03-241-6/+26
|\ \ | |/ | | | | | | | | Issue #21925: warnings.formatwarning() now catches exceptions when calling linecache.getline() and tracemalloc.get_object_traceback() to be able to log ResourceWarning emitted late during the Python shutdown process.
| * warnings.formatwarning(): catch exceptionsVictor Stinner2016-03-241-0/+17
| | | | | | | | | | | | Issue #21925: warnings.formatwarning() now catches exceptions on linecache.getline(...) to be able to log ResourceWarning emitted late during the Python shutdown process.
| * Fix test_warnings.test_improper_option()Victor Stinner2016-03-241-6/+9
| | | | | | | | | | test_warnings: only run test_improper_option() and test_warnings_bootstrap() once. The unit test doesn't depend on self.module.
* | Issue #26588: remove debug traces from _tracemalloc.Victor Stinner2016-03-221-1/+0
| |
* | Issue #26588: skip test_warnings.test_tracemalloc()Victor Stinner2016-03-221-0/+1
| |
* | Try again to fix test_warnings on WindowsVictor Stinner2016-03-191-0/+2
| | | | | | | | Issue #26567: normalize newlines in test_tracemalloc.
* | Try to fix test_warnings on WindowsVictor Stinner2016-03-191-8/+10
| | | | | | | | Issue #26567.
* | On ResourceWarning, log traceback where the object was allocatedVictor Stinner2016-03-191-0/+30
| | | | | | | | | | | | | | | | | | | | Issue #26567: * Add a new function PyErr_ResourceWarning() function to pass the destroyed object * Add a source attribute to warnings.WarningMessage * Add warnings._showwarnmsg() which uses tracemalloc to get the traceback where source object was allocated.
* | Add _showwarnmsg() and _formatwarnmsg() to warningsVictor Stinner2016-03-181-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26568: add new _showwarnmsg() and _formatwarnmsg() functions to the warnings module. The C function warn_explicit() now calls warnings._showwarnmsg() with a warnings.WarningMessage as parameter, instead of calling warnings.showwarning() with multiple parameters. _showwarnmsg() calls warnings.showwarning() if warnings.showwarning() was replaced. Same for _formatwarnmsg(): call warnings.formatwarning() if it was replaced.
* | Merge from 3.5Steve Dower2015-09-071-1/+1
|/
* Reapplied change to test_warnings.py to test_warnings/__init__.py.Steve Dower2015-09-071-0/+6
|
* Issue #24305: Prevent import subsystem stack frames from being countedLarry Hastings2015-09-064-0/+970
by the warnings.warn(stacklevel=) parameter.