summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings.py
Commit message (Collapse)AuthorAgeFilesLines
* [2.7] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry ↵Serhiy Storchaka2017-09-111-0/+11
| | | | | is not a dictionary. (GH-3485). (#3493) (cherry picked from commit 252033d50effa08046ac34fcc406bc99796ab88b)
* Issue #27528: Document and test warning messages must match at beginningMartin Panter2016-07-191-0/+12
|
* Issue #23029: Fix catch_warnings() in test_filename_noneBerker Peksag2016-04-161-1/+4
| | | | | It was printed UserWarning output because catch_warnings() was missing record=True.
* Issue #23637: Showing a warning no longer fails with UnicodeErrror.Serhiy Storchaka2015-05-161-0/+57
| | | | | Formatting unicode warning in the file with the path containing non-ascii characters no longer fails with UnicodeErrror.
* Issue #23016: A warning no longer produces an AttributeError when sys.stderrSerhiy Storchaka2014-12-101-0/+9
| | | | is None.
* Issue #22191: Fix warnings.__all__.Brett Cannon2014-08-221-0/+19
| | | | Thanks to Jon Poler for the patch.
* Issue #19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-101-1/+1
|
* Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-2/+1
|
* Issue #12467: warnings: fix a race condition if a warning is emitted atVictor Stinner2011-07-041-0/+12
| | | | shutdown, if globals()['__file__'] is None.
* #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-1/+1
|
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-11/+11
| | | | | | | | | | 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. ........
* I'm only backporting the tests here.Antoine Pitrou2010-11-101-0/+17
| | | | | | | | | | | | Merged revisions 86395 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86395 | antoine.pitrou | 2010-11-10 14:55:25 +0100 (mer., 10 nov. 2010) | 4 lines Issue #10372: Import the warnings module only after the IO library is initialized, so as to avoid bootstrap issues with the '-W' option. ........
* fix PYTHONWARNINGS handling to not modify the original env value and improvePhilip Jenvey2010-04-101-3/+6
| | | | its tests
* #7301: add the environment variable $PYTHONWARNINGS to supplement the -WPhilip Jenvey2010-04-061-0/+39
| | | | | command line option patch from Brian Curtin
* Fix test_unittest and test_warnings when running "python -Werror -m ↵Florent Xicluna2010-03-251-0/+5
| | | | test.regrtest"
* #8155: Preserve backward compatibility for test_support.check_warnings(). ↵Florent Xicluna2010-03-181-12/+26
| | | | Add regression tests.
* use assert[Not]In where appropriateEzio Melotti2010-01-231-1/+1
|
* Issue #6415: Fixed warnings.warn sagfault on bad formatted string.Hirokazu Yamamoto2009-07-171-0/+13
|
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-32/+32
|
* Issue 5354: Change API for import_fresh_module() to better support ↵Nick Coghlan2009-04-221-2/+2
| | | | test_warnings use case (also fixes some bugs in the original implementation)
* Issue 5354: Provide a standardised testing mechanism for doing fresh imports ↵Nick Coghlan2009-04-111-12/+14
| | | | of modules, including the ability to block extension modules in order to test the pure Python fallbacks
* test_warnings ironically had a single test that was not protecting the warningsBrett Cannon2009-04-011-8/+8
| | | | filter and was resetting it.
* _warnings was importing itself to get an attribute. That's bad if warnings getsBrett Cannon2009-04-011-0/+35
| | | | | | called in a thread that was spawned by an import itself. Last part to close #1665206.
* Require implementations for warnings.showwarning() support the 'line' argument.Brett Cannon2009-03-111-37/+0
| | | | | | Was a DeprecationWarning for not supporting it since Python 2.6. Closes issue #3652.
* Issue #3781: Final cleanup of warnings.catch_warnings and its usage in the ↵Nick Coghlan2008-09-111-2/+55
| | | | test suite. Closes issue w.r.t. 2.6 (R: Brett Cannon)
* warnings.catch_warnings() now returns a list or None instead of the customBrett Cannon2008-09-091-60/+82
| | | | | | | | WarningsRecorder object. This makes the API simpler to use as no special object must be learned. Closes issue 3781. Review by Benjamin Peterson.
* Deprecate bsddb for removal in Python 3.0.Brett Cannon2008-09-051-0/+1
| | | | | Closes issue 3776. Review by Nick Coghlan.
* Move test.test_support.catch_warning() to the warnings module, rename itBrett Cannon2008-09-021-34/+40
| | | | | | | | | | | catch_warnings(), and clean up the API. While expanding the test suite, a bug was found where a warning about the 'line' argument to showwarning() was not letting functions with '*args' go without a warning. Closes issue 3602. Code review by Benjamin Peterson.
* Make test.test_support.catch_warnings more robust as discussed on ↵Nick Coghlan2008-07-131-1/+44
| | | | python-dev. Also add explicit tests for itto test_warnings.
* warnings.warn_explicit() did not have the proper TypeErrors in place to preventBrett Cannon2008-06-271-0/+15
| | | | | | | | bus errors or SystemError being raised. As a side effect of fixing this, a bad DECREF that could be triggered when 'message' and 'category' were both None was fixed. Closes issue 3211. Thanks JP Calderone for the bug report.
* Fix another "refleak" by clearing the filters after test.Georg Brandl2008-05-141-0/+1
|
* Fix logic error in Python/_warnings.c and add a test to verifyBenjamin Peterson2008-05-061-0/+9
|
* Fix a bug in the handling of the stacklevel argument in warnings.warn() whereBrett Cannon2008-05-061-0/+2
| | | | the stack was being unwound by two levels instead of one each time.
* Add a DeprecationWarning for when warnings.showwarning() is set to a functionBrett Cannon2008-05-051-0/+28
| | | | that lacks support for the new 'line' argument.
* Fix the C implementation of 'warnings' to infer the filename of the module thatBrett Cannon2008-05-031-0/+71
| | | | | | | raised an exception properly when __file__ is not set, __name__ == '__main__', and sys.argv[0] is a false value. Closes issue2743.
* Some tests did not pass on repeated calls (regrtest -R::)Amaury Forgeot d'Arc2008-04-181-0/+2
| | | | Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry.
* Fix spliting on colons on Windows machines with a file path by limiting theBrett Cannon2008-04-131-3/+1
| | | | number of splits.
* Add an explicit check for output in a test to try to diagnose a failure onBrett Cannon2008-04-131-1/+4
| | | | Windows.
* Fix test_warnings by making the state of things more consistent for each testBrett Cannon2008-04-131-29/+42
| | | | when it is run.
* Re-implement the 'warnings' module in C. This allows for usage of theBrett Cannon2008-04-121-75/+323
| | | | | | | | | 'warnings' code in places where it was previously not possible (e.g., the parser). It could also potentially lead to a speed-up in interpreter start-up if the C version of the code (_warnings) is imported over the use of the Python version in key places. Closes issue #1631171.
* Add tests for the warnings module; specifically formatwarning and showwarning.Brett Cannon2007-12-201-1/+32
| | | | Still need tests for warn_explicit and simplefilter.
* Make test_warnings re-entrant.Brett Cannon2007-08-171-0/+5
|
* Remove test.test_support.guard_warnings_filter.Brett Cannon2007-08-141-1/+1
| | | | | | | | 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.
* Implement a contextmanager test.test_support.catch_warning that canWalter Dörwald2007-04-031-94/+68
| | | | | | | be used to catch the last warning issued by the warning framework. Change test_warnings.py and test_structmembers.py to use this new contextmanager.
* Add tests for the filename.Walter Dörwald2007-04-031-0/+24
| | | | Test that the stacklevel is handled correctly.
* Document that CatchWarningTests is reused by test_structmembers.py.Walter Dörwald2007-04-031-0/+2
|
* Move the functionality for catching warnings in test_warnings.py into a separateWalter Dörwald2007-04-031-1/+3
| | | | | class to that reusing the functionality in test_structmembers.py doesn't rerun the tests from test_warnings.py.
* Whitespace normalization.Tim Peters2006-06-271-1/+1
|
* 'warning's was improperly requiring that a command-line Warning category beBrett Cannon2006-06-221-0/+13
| | | | | | | both a subclass of Warning and a subclass of types.ClassType. The latter is no longer true thanks to new-style exceptions. Closes bug #1510580. Thanks to AMK for the test.
* Make test_warnings play nice with regrtest -R:: now that regrtest doesn'tThomas Wouters2006-04-161-4/+4
| | | | | always reload the module (specifically, it doesn't reload if the module has a 'test_main'.)