summaryrefslogtreecommitdiff
path: root/Lib/test/test_logging.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-43842: Fix race condition in test_logging SMTP test (GH-25436) ↵Victor Stinner2021-04-161-2/+5
| | | | | | | | | | (GH-25437) (GH-25440) Fix a race condition in the SMTP test of test_logging. Don't close a file descriptor (socket) from a different thread while asyncore.loop() is polling the file descriptor. (cherry picked from commit 75ec103b3adbb7c619a0e22fa60f3d34c5a9e603) (cherry picked from commit e1903e11a3d42512effe336026e0c67f602e5848)
* bpo-42644: Validate values in logging.disable() (GH-23786)Miss Islington (bot)2020-12-161-0/+9
| | | | | | | | | | | | | | | | | | | | | | * bpo-42644: Validate values in logging.disable() Technically make the value of manager a property that checks and convert values assigned to it properly. This has the side effect of making `logging.disable` also accept strings representing the various level of warnings. We want to validate the type of the disable attribute at assignment time, as it is later compared to other levels when emitting warnings and would generate a `TypeError: '>=' not supported between ....` in a different part of the code base, which can make it difficult to track down. When assigned an incorrect value; it will raise a TypeError when the wrong type, or ValueError if an invalid str. Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com> (cherry picked from commit b32d8b4f9bcd2e7d11240b6b9de0262cf8f5e09d) Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
* bpo-41739: Fix test_logging.test_race_between_set_target_and_flush() ↵Miss Skeleton (bot)2020-10-121-8/+13
| | | | | | | | | | | | | | | (GH-22655) (GH-22656) (GH-22662) The test now waits until all threads complete to avoid leaking running threads. Also, use regular threads rather than daemon threads. (cherry picked from commit 13ff396c019d548ba181cf22c6f39309a300723c) (cherry picked from commit f5393dc2a0ced7bf670ebc56b5fd10a3eb328d1a) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.8] bpo-41503: Fix race between setTarget and flush in ↵Miss Islington (bot)2020-08-161-0/+21
| | | | | | | | | | logging.handlers.MemoryHandler (GH-21765) (GH-21898) (cherry picked from commit 2353d77fad7ed9d11d8a4d66b5dd1306cdb94125) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com> Automerge-Triggered-By: @vsajip
* bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() ↵Victor Stinner2020-06-181-4/+4
| | | | | | | | | | | (GH-20944) (GH-20962) (GH-20966) On Linux, skip tests using multiprocessing if the current user cannot create a file in /dev/shm/ directory. Add the skip_if_broken_multiprocessing_synchronize() function to the test.support module. (cherry picked from commit ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881) (cherry picked from commit b1e736113484c99acb57e4acb417b91a9e58e7ff)
* bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. ↵Miss Islington (bot)2020-01-011-0/+31
| | | | | | (GH-17773) (GH-17785) (cherry picked from commit 46abfc1416ff8e450999611ef8f231ff871ab133)
* Updated incorrect level-setting code to use setLevel(). (GH-16325) (GH-16327)Miss Islington (bot)2019-09-221-1/+1
| | | | (cherry picked from commit 1d094af716e8ce5e5710e1dfbce7832ba333be55)
* bpo-37258: Not a bug, but added a unit test and updated documentation. ↵Miss Islington (bot)2019-06-191-0/+31
| | | | | | (GH-14229) (GH-14230) (cherry picked from commit 015000165373f8db263ef5bc682f02d74e5782ac)
* bpo-36813: Fix QueueListener to call task_done() upon termination. (GH-13113)Bar Harel2019-06-011-0/+10
| | | | | | | | Fixed QueueListener in order to avoid random deadlocks. Unable to add regression tests atm due to time constraints, will add it in a bit. Regarding implementation, although it's nested, it does not cause performance issues whatsoever, and does not call task_done() in case of an exception (which is the right thing to do IMHO). https://bugs.python.org/issue36813
* bpo-36903: Fix ResourceWarning in test_logging (GH-13283)Xtreak2019-05-131-0/+1
|
* bpo-36015: Handle StreamHandler representaton of stream with an integer name ↵Riccardo Magliocchetti2019-05-071-0/+8
| | | | (GH-11908)
* bpo-36533: Reinit logging.Handler locks on fork(). (GH-12704)Gregory P. Smith2019-05-071-4/+27
| | | | | Instead of attempting to acquire and release them all across fork which was leading to deadlocks in some applications that had chained their own handlers while holding multiple locks.
* bpo-36681: Remove duplicate test_regression_29220 function (GH-12894)Windson yang2019-04-221-6/+0
|
* bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659)Xtreak2019-04-071-0/+13
|
* bpo-36272: Logging now propagates RecursionError (GH-12312)Rémi Lapeyre2019-03-151-1/+16
|
* bpo-34997: Fix test_logging.ConfigDictTest.test_out_of_order (GH-9913)Pablo Galindo2018-10-161-1/+2
| | | | | | | | When runnint test_logging with --huntrleaks after commit 18fb1fb943b7dbd7f8a76017ee2a67ef13effb85, test_out_of_order fails to raise ValueError due to the fact that the new test test_out_of_order_with_dollar_style mutates the out_of_order dictionary. Even if the test copies the dictionary first, the mutation is done in a very deep level so the original one is also affected.
* bpo-34844: logging.Formatter enhancement - Ensure style and format string ↵BNMetrics2018-10-151-16/+316
| | | | matches in logging.Formatter (GH-9703)
* bpo-34334: Don't log traceback twice in QueueHandler (GH-9537)Cheryl Sabella2018-09-261-0/+15
|
* bpo-6721: Hold logging locks across fork() (GH-4071)Gregory P. Smith2018-09-131-0/+67
| | | | | | | | | bpo-6721: When os.fork() was called while another thread holds a logging lock, the child process may deadlock when it tries to log. This fixes that by acquiring all logging locks before fork and releasing them afterwards. A regression test that fails before this change is included. Within the new unittest itself: There is a small _potential_ due to mixing of fork and a thread in the child process if the parent's thread happened to hold a non-reentrant library call lock (malloc?) when the os.fork() happens. buildbots and time will tell if this actually manifests itself in this test or not. :/ A functionality test that avoids that would be a challenge. An alternate test that isn't trying to produce the deadlock itself but just checking that the release and acquire calls are made would be the next best alternative if so.
* bpo-34092, test_logging: increase SMTPHandlerTest timeout (GH-8245)Victor Stinner2018-07-111-2/+3
| | | | | Change test_logging.SMTPHandlerTest timeout from 8 seconds to 1 minute. The test failed randomly on the slow x86 Gentoo Refleaks 3.7 buildbot.
* bpo-33978: Close existing handlers before logging (re-)configuration. (GH-8008)Xtreak2018-07-021-0/+75
|
* bpo-33897: Add a 'force' keyword argument to logging.basicConfig(). (GH-7873)Dong-hee Na2018-06-251-0/+21
|
* bpo-33802: Do not interpolate in ConfigParser while reading defaults (GH-7524)Łukasz Langa2018-06-081-0/+43
| | | This solves a regression in logging config due to changes in BPO-23835.
* bpo-33165: Added stacklevel parameter to logging APIs. (GH-7424)Vinay Sajip2018-06-051-0/+31
|
* bpo-33606: improve logging performance when logger is disabled (GH-7285)Timo Furrer2018-06-011-0/+12
| | | A check has been added in Logger.isEnabledFor() to return False when the logger is disabled. This avoids unnecessary work being done when a disabled logger is used.
* bpo-32593: Drop FreeBSD 9 and older support (#5232)Victor Stinner2018-01-221-8/+1
| | | Drop support of FreeBSD 9 and older.
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-25/+25
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* bpo-28668: test.support.requires_multiprocessing_queue is removed (GH-4560)xdegaye2017-12-011-2/+6
| | | | Skip tests with test.support.import_module('multiprocessing.synchronize') instead when the semaphore implementation is broken or missing.
* bpo-31457: Don't omit inner ``process()`` calls with nested LogAdapters (#4044)Łukasz Langa2017-10-191-6/+14
| | | | | | | | | | | This used to be the case on Python 2. Commit 212b590e118e3650b596917021ed9612a918180b changed the implementation for Python 3, making the `log()` method of LogAdapter call `logger._log()` directly. This makes nested log adapters not execute their ``process()`` method. This patch fixes the issue. Also, now proxying `name`, too, to make `repr()` work with nested log adapters. New tests added.
* bpo-31457: Make the `LoggerAdapter.manager` property settable (#4042)Łukasz Langa2017-10-181-1/+14
| | | | Due to a bug in the initial fix, the setter was in fact creating a different property. This is now fixed.
* bpo-31346: Use PROTOCOL_TLS_CLIENT/SERVER (#3058)Christian Heimes2017-09-151-1/+1
| | | | | | Replaces PROTOCOL_TLSv* and PROTOCOL_SSLv23 with PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31234: Add support.join_thread() helper (#3587)Victor Stinner2017-09-141-12/+4
| | | | join_thread() joins a thread but raises an AssertionError if the thread is still alive after timeout seconds.
* bpo-31457: Allow for nested LoggerAdapter objects (#3551)Łukasz Langa2017-09-141-0/+11
| | | | | | Some of the proxied methods use internal Logger state which isn't proxied, causing failures if an adapter is applied to another adapter. This commit fixes the issue, adds a new test for the use case.
* bpo-31233: socketserver.ThreadingMixIn.server_close() (#3523)Victor Stinner2017-09-131-11/+2
| | | | | | | | | socketserver.ThreadingMixIn now keeps a list of non-daemonic threads to wait until all these threads complete in server_close(). Reenable test_logging skipped tests. Fix SocketHandlerTest.tearDown(): close the socket handler before stopping the server, so the server can join threads.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-278/+256
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-31235: Fix ResourceWarning in test_logging (#3147)Victor Stinner2017-08-191-0/+2
|
* bpo-30830: test_logging uses threading_setup/cleanup (#3137)Victor Stinner2017-08-181-9/+14
| | | | | | | | | | | | | | | | | * bpo-30830: test_logging uses threading_setup/cleanup Replace @support.reap_threads on some methods with support.threading_setup() in setUp() and support.threading_cleanup() in tearDown() in BaseTest. * bpo-30830: test_logging disables threaded socketserver tests Disable tests because of socketserver.ThreadingMixIn leaks threads, whereas leaking threads now makes a test to fail on buildbots. Disable tests until socketserver is fixed: bpo-31233. * Skip also setup_via_listener()
* bpo-31080: Allowed logging.config.fileConfig() to accept both args and ↵Preston Landers2017-08-021-2/+2
| | | | kwargs. (GH-2979)
* bpo-31084: QueueHandler now formats messages correctly. (GH-2954)favll2017-08-011-0/+14
|
* bpo-30522: Implemented a method to allow setting a logging.StreamHander's ↵Vinay Sajip2017-07-301-0/+14
| | | | stream. (GH-2921)
* bpo-30962: Added caching to Logger.isEnabledFor() (GH-2752)Avram Lubkin2017-07-301-1/+59
|
* bpo-30520: Implemented pickling for loggers. (#1956)Vinay Sajip2017-06-061-0/+8
| | | Implemented pickling for loggers.
* bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses ↵Xiang Zhang2017-06-011-2/+20
| | | | (#1676)
* bpo-30131: test_logging now joins queue threads (#1298)Victor Stinner2017-04-261-0/+8
| | | | | | | | QueueListenerTest of test_logging now closes the multiprocessing Queue and joins its thread to prevent leaking dangling threads to following tests. Add also @support.reap_threads to detect earlier if a test leaks threads (and try to "cleanup" these threads).
* bpo-30131: Cleanup threads in test_logging (#1275)Victor Stinner2017-04-251-0/+15
| | | | * Use @support.reap_threads on unit tests creating threads * Call TestCase.fail() on thread.join(timeout) failure
* Issue #29220: Merged fixes from 3.6.Vinay Sajip2017-01-111-0/+8
|\
| * Issue #292Merged fixes from 3.5.Vinay Sajip2017-01-111-0/+8
| |\
| | * Issue #29220: Improved fix and test.Vinay Sajip2017-01-111-0/+8
| | |
* | | Closes #29220: Fixed regression in logging.getLevelName().Vinay Sajip2017-01-111-0/+6
| | |
* | | Closes #29177: Merged fix from 3.6.Vinay Sajip2017-01-091-24/+62
|\ \ \ | |/ /