summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings
Commit message (Collapse)AuthorAgeFilesLines
* bpo-43651: Fix EncodingWarning in test_warnings (GH-25126)Inada Naoki2021-04-011-3/+3
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21452)Hai Shi2020-08-041-17/+23
|
* bpo-41069: Make TESTFN and the CWD for tests containing non-ascii ↵Serhiy Storchaka2020-06-251-3/+3
| | | | characters. (GH-21035)
* bpo-41113: Fix test_warnings on non-Western locales. (GH-21143)Serhiy Storchaka2020-06-251-3/+3
|
* bpo-39489: Remove COUNT_ALLOCS special build (GH-18259)Victor Stinner2020-02-031-1/+0
| | | | | | | | | | | Remove: * COUNT_ALLOCS macro * sys.getcounts() function * SHOW_ALLOC_COUNT code in listobject.c * SHOW_TRACK_COUNT code in tupleobject.c * PyConfig.show_alloc_count field * -X showalloccount command line option * @test.support.requires_type_collecting decorator
* bpo-39056: Fix handling invalid warning category in the -W option. (GH-17618)Serhiy Storchaka2020-01-051-0/+23
| | | No longer import the re module if it is not needed.
* bpo-38991: Remove test.support.strip_python_stderr() (GH-17490)Victor Stinner2019-12-081-1/+2
| | | | | test.support: run_python_until_end(), assert_python_ok() and assert_python_failure() functions no longer strip whitespaces from stderr.
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-301-1/+1
|
* bpo-20443: _PyConfig_Read() gets the absolute path of run_filename (GH-14053)Victor Stinner2019-06-251-10/+9
| | | | | | | | | | | | Python now gets the absolute path of the script filename specified on the command line (ex: "python3 script.py"): the __file__ attribute of the __main__ module, sys.argv[0] and sys.path[0] become an absolute path, rather than a relative path. * Add _Py_isabs() and _Py_abspath() functions. * _PyConfig_Read() now tries to get the absolute path of run_filename, but keeps the relative path if _Py_abspath() fails. * Reimplement os._getfullpathname() using _Py_abspath(). * Use _Py_isabs() in getpath.c.
* bpo-35178: Fix warnings._formatwarnmsg() (GH-12033)Xtreak2019-03-011-0/+19
| | | | | Ensure custom formatwarning function can receive line as positional argument. Co-Authored-By: Tashrif Billah <tashrifbillah@gmail.com>
* bpo-29564: warnings suggests to enable tracemalloc (GH-10486)Victor Stinner2018-11-131-5/+20
| | | | | The warnings module now suggests to enable tracemalloc if the source is specified, tracemalloc module is available, but tracemalloc is not tracing memory allocations.
* Fixed several assertTrue() that were intended to be assertEqual(). (GH-8191)Sergey Fedoseev2018-07-091-4/+8
| | | Fixed also testing the "always" warning filter.
* bpo-33912: Fix test_warnings when run with -Werror (GH-7839)Christopher Frederickson2018-06-211-0/+1
| | | Add missing warning filter to test_exec_filename().
* bpo-33375: Get filename for warnings from frame.f_code.co_filename (GH-6622)Thomas Kluyver2018-06-081-75/+9
| | | More consistent with how other parts of Python find the filename (e.g. tracebacks and pdb).
* bpo-33509: Fix test_warnings for python3 -Werror (GH-7365)Victor Stinner2018-06-041-0/+2
| | | | Fix test_warnings.test_module_globals() when python3 is run with -Werror.
* bpo-33509: Fix _warnings for module_globals=None (#6833)Victor Stinner2018-05-151-0/+19
| | | Don't crash on warnings.warn_explicit() if module_globals is not a dict.
* bpo-31975 (PEP 565): Show DeprecationWarning in __main__ (GH-4458)Nick Coghlan2018-01-081-1/+35
| | | | | | | | | | | | | - primary change is to add a new default filter entry for 'default::DeprecationWarning:__main__' - secondary change is an internal one to cope with plain strings in the warning module's internal filter list (this avoids the need to create a compiled regex object early on during interpreter startup) - assorted documentation updates, including many more examples of configuring the warnings settings - additional tests to ensure that both the pure Python and the C accelerated warnings modules have the expected default configuration
* bpo-32230: Set sys.warnoptions with -X dev (#4820)Victor Stinner2017-12-121-5/+10
| | | | | | | | | | | | | | Rather than supporting dev mode directly in the warnings module, this instead adjusts the initialisation code to add an extra 'default' entry to sys.warnoptions when dev mode is enabled. This ensures that dev mode behaves *exactly* as if `-Wdefault` had been passed on the command line, including in the way it interacts with `sys.warnoptions`, and with other command line flags like `-bb`. Fix also bpo-20361: have -b & -bb options take precedence over any other warnings options. Patch written by Nick Coghlan, with minor modifications of Victor Stinner.
* bpo-32121: Add most_recent_first parameter to tracemalloc.Traceback.format ↵Jesse-Bakker2017-11-291-3/+3
| | | | | | | | (#4534) * Add most_recent_first parameter to tracemalloc.Traceback.format to allow reversing the order of the frames in the output * Reversed default sorting of tracemalloc.Traceback frames * Allowed negative limit, truncating from the other side.
* bpo-27535: Fix memory leak with warnings ignore (#4489)Victor Stinner2017-11-271-0/+1
| | | | | | | The warnings module doesn't leak memory anymore in the hidden warnings registry for the "ignore" action of warnings filters. The warn_explicit() function doesn't add the warning key to the registry anymore for the "ignore" action.
* bpo-31566: Fix an assertion failure in _warnings.warn() in case of a bad ↵Oren Milman2017-09-241-0/+10
| | | | __name__ global. (#3717)
* bpo-31285: Fix an assertion failure and a SystemError in ↵Oren Milman2017-09-241-0/+36
| | | | warnings.warn_explicit. (#3219)
* bpo-31416: Fix assertion failures in case of a bad warnings.filters or ↵Oren Milman2017-09-111-0/+15
| | | | | warnings.defaultaction. (#3496) Patch by Oren Milman.
* bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is ↵Oren Milman2017-09-111-0/+11
| | | | not a dictionary. (#3485)
* Spelling fixes (#2902)Ville Skyttä2017-08-031-1/+1
|
* bpo-30812: Fix test_warnings, restore _showwarnmsg (#2504)Victor Stinner2017-06-301-4/+9
| | | | bpo-26568, bpo-30812: Fix test_showwarnmsg_missing(): restore the attribute after removing it.
* bpo-20548: Use specific asserts in warnings and exceptions tests (#788)Serhiy Storchaka2017-03-301-20/+20
|
* 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
|/