summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-72719: Remove asyncore and asynchat modules (#96580)Nikita Sobolev2022-11-081-3/+1
| | | | | Remove modules asyncore and asynchat, which were deprecated by PEP 594. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-90195: Unset logger disabled flag when configuring it. (GH-96530)Vinay Sajip2022-09-031-0/+29
|
* gh-89258: Add a getChildren() method to logging.Logger. (GH-96444)Vinay Sajip2022-08-311-0/+14
| | | Co-authored-by: Éric <merwok@netwok.org>
* gh-89047: Fix msecs computation so you never end up with 1000 msecs. (GH-96340)Vinay Sajip2022-08-271-0/+8
|
* gh-95804: Respect MemoryHandler.flushOnClose in logging shutdown. (GH-95857)David Bonner2022-08-101-0/+29
|
* gh-93243: Make smtpd private before porting its users (GH-93246)Oleg Iarygin2022-08-061-1/+2
| | | | | | | gh-93243 This PR is required to reduce diffs of the following porting (no need to either maintain documentation and tests consistent with each porting step, or try to port everything and remove smtpd in a single PR). Automerge-Triggered-By: GH:warsaw
* bpo-46755: Don't log stack info twice in QueueHandler (GH-31355)Erik Montnemery2022-07-051-1/+3
|
* gh-93761: Fix test_logging test_config_queue_handler() race condition (#93952)Victor Stinner2022-06-191-0/+3
| | | Fix a race condition in test_config_queue_handler() of test_logging.
* gh-93852: Add test.support.create_unix_domain_name() (#93914)Victor Stinner2022-06-171-21/+6
| | | | | | | | | | | | | | | test_asyncio, test_logging, test_socket and test_socketserver now create AF_UNIX domains in the current directory to no longer fail with OSError("AF_UNIX path too long") if the temporary directory (the TMPDIR environment variable) is too long. Modify the following tests to use create_unix_domain_name(): * test_asyncio * test_logging * test_socket * test_socketserver test_asyncio.utils: remove unused time import.
* test_logging: Fix BytesWarning in SysLogHandlerTest (GH-93920)Victor Stinner2022-06-171-1/+1
|
* Call busy_retry() and sleeping_retry() with error=True (#93871)Victor Stinner2022-06-161-3/+2
| | | | Tests no longer call busy_retry() and sleeping_retry() with error=False: raise an exception if the loop times out.
* Use support.sleeping_retry() and support.busy_retry() (#93848)Victor Stinner2022-06-151-6/+7
| | | | | | * Replace time.sleep(0.010) with sleeping_retry() to use an exponential sleep. * support.wait_process(): reuse sleeping_retry(). * _test_eintr: remove unused variables.
* gh-93761: Fix test to avoid simple delay when synchronizing. (GH-93779)Vinay Sajip2022-06-141-3/+5
|
* gh-92592: Allow logging filters to return a LogRecord. (GH-92591)Adrian Garcia Badaracco2022-06-071-0/+45
|
* gh-93162: test_config_queue_handler requires threading (GH-93572)Christian Heimes2022-06-071-0/+1
|
* gh-93162: Add ability to configure QueueHandler/QueueListener together ↵Vinay Sajip2022-06-071-19/+127
| | | | | | | (GH-93269) Also, provide getHandlerByName() and getHandlerNames() APIs. Closes #93162.
* gh-84461: Skip new async logging tests on Emscripten (GH-93427)Christian Heimes2022-06-021-0/+3
|
* gh-91513: Tidied up a test and did minor refactoring around test filename ↵Vinay Sajip2022-05-261-23/+25
| | | | gener… (GH-93265)
* gh-91513: Add 'asyncio' taskName to logging LogRecord attributes. (GH-93193)jackh-ncl2022-05-261-4/+62
|
* gh-90473: Decrease recursion limit and skip tests on WASI (GH-92803)Christian Heimes2022-05-191-0/+2
|
* bpo-45046: Support context managers in unittest (GH-28045)Serhiy Storchaka2022-05-081-3/+1
| | | | | | Add methods enterContext() and enterClassContext() in TestCase. Add method enterAsyncContext() in IsolatedAsyncioTestCase. Add function enterModuleContext().
* gh-92169: Use warnings_helper.import_deprecated() to import deprecated ↵Hugo van Kemenade2022-05-031-4/+4
| | | | modules uniformly in tests (GH-92170)
* bpo-40280: Detect missing threading on WASM platforms (GH-32352)Christian Heimes2022-04-071-0/+10
| | | Co-authored-by: Brett Cannon <brett@python.org>
* bpo-45171: Remove tests of deprecated logger.warn(). (GH-32139)Jouke Witteveen2022-03-271-3/+0
|
* bpo-45171: Fix stacklevel handling in logging. (GH-28287)Jouke Witteveen2022-03-271-1/+12
|
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-0/+12
| | | | | | | | | | | - Add requires_fork and requires_subprocess to more tests - Skip extension import tests if dlopen is not available - Don't assume that _testcapi is a shared extension - Skip a lot of socket tests that don't work on Emscripten - Skip mmap tests, mmap emulation is incomplete - venv does not work yet - Cannot get libc from executable The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
* bpo-40280: Skip more tests on Emscripten (GH-31947)Christian Heimes2022-03-171-1/+2
| | | | | | - lchmod, lchown are not fully implemented - skip umask tests - cannot fstat unlinked or renamed files yet - ignore musl libc issues that affect Emscripten
* bpo-41906: Accept built filters in dictConfig (GH-30756)Mario Corchero2022-01-241-0/+38
| | | | | | | When configuring the logging stack, accept already built filters (or just callables) in the filters array of loggers and handlers. This facilitates passing quick callables as filters. Automerge-Triggered-By: GH:vsajip
* bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638)Irit Katriel2022-01-181-2/+2
|
* bpo-46063: Add 'delay=True' to file handler initialization. (GH-30103)Vinay Sajip2021-12-141-1/+2
|
* bpo-46063: Improve algorithm for computing which rolled-over log file… ↵Vinay Sajip2021-12-141-2/+50
| | | | (GH-30093)
* Revert "bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)" ↵Victor Stinner2021-12-071-2/+5
| | | | | (GH-29951) This reverts commit 9bf2cbc4c498812e14f20d86acb61c53928a5a57.
* bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)Victor Stinner2021-11-151-5/+2
| | | | | | | | | | | | | | | | Remove the asyncore and asynchat modules, deprecated in Python 3.6: use the asyncio module instead. Remove the smtpd module, deprecated in Python 3.6: the aiosmtpd module can be used instead, it is based on asyncio. * Remove asyncore, asynchat and smtpd documentation * Remove test_asyncore, test_asynchat and test_smtpd * Rename Lib/asynchat.py to Lib/test/support/_asynchat.py * Rename Lib/asyncore.py to Lib/test/support/_asyncore.py * Rename Lib/smtpd.py to Lib/test/support/_smtpd.py * Remove DeprecationWarning from private _asyncore, _asynchat and _smtpd modules * _smtpd: remove deprecated properties
* bpo-45401: Fix a resource warning in test_logging (GH-28864)Serhiy Storchaka2021-10-111-0/+1
|
* bpo-45401: Change shouldRollover() methods to only rollover regular f… ↵Vinay Sajip2021-10-101-0/+15
| | | | | | | (GH-28822) …iles. Also changed some historical return values from 1 -> True and 0 -> False.
* bpo-45128: fixes `test_multiprocessing_fork` mysterious crash (GH-28387)Nikita Sobolev2021-09-191-3/+4
|
* bpo-45229: Remove test_main in many tests (GH-28405)Serhiy Storchaka2021-09-191-20/+6
| | | | | | | | | Instead of explicitly enumerate test classes for run_unittest() use the unittest ability to discover tests. This also makes these tests discoverable and runnable with unittest. load_tests() can be used for dynamic generating tests and adding doctests. setUpModule(), tearDownModule() and addModuleCleanup() can be used for running code before and after all module tests.
* bpo-44291: Fix reconnection in logging.handlers.SysLogHandler (GH-26490)Kirill Pinchuk2021-08-051-0/+8
|
* bpo-44740: Lowercase "internet" and "web" where appropriate. (#27378)Mariusz Felisiak2021-07-261-1/+1
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-42378: fixed log truncation on logging shutdown (GH-27310)andrei kulakov2021-07-251-4/+14
| | | Automerge-Triggered-By: GH:vsajip
* bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in ↵Irit Katriel2021-06-241-2/+5
| | | | tests (GH-26905)
* bpo-43858: Add logging.getLevelNamesMapping() (GH-26459)andrei kulakov2021-06-031-0/+8
| | | Added a function that returns a copy of a dict of logging levels.
* bpo-43651: Fix test_logging (GH-25715)Inada Naoki2021-04-291-2/+1
|
* bpo-43651: Fix EncodingWarning in tests. (GH-25655)Inada Naoki2021-04-291-13/+17
| | | | | * test_httplib * test_httpservers * test_logging
* bpo-43961: Fix test_logging.test_namer_rotator_inheritance() (GH-25684)Victor Stinner2021-04-281-1/+1
| | | | Fix test_logging.test_namer_rotator_inheritance() on Windows: use os.replace() rather than os.rename().
* bpo-43842: Fix race condition in test_logging SMTP test (GH-25436)Victor Stinner2021-04-161-2/+5
| | | | | 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.
* bpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361)Christian Heimes2021-04-121-2/+2
|
* bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25189)Inada Naoki2021-04-061-15/+16
| | | | | | | | | | | | * Fix _sitebuiltins * Fix test_inspect * Fix test_interpreters * Fix test_io * Fix test_iter * Fix test_json * Fix test_linecache * Fix test_lltrace * Fix test_logging * Fix logging
* bpo-42644: Validate values in logging.disable() (#23786)Matthias Bussonnier2020-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>
* bpo-26789: Fix logging.FileHandler._open() at exit (GH-23053)Victor Stinner2020-11-021-5/+38
| | | | | | | | | | | | | | | | | | | The logging.FileHandler class now keeps a reference to the builtin open() function to be able to open or reopen the file during Python finalization. Fix errors like: Exception ignored in: (...) Traceback (most recent call last): (...) File ".../logging/__init__.py", line 1463, in error File ".../logging/__init__.py", line 1577, in _log File ".../logging/__init__.py", line 1587, in handle File ".../logging/__init__.py", line 1649, in callHandlers File ".../logging/__init__.py", line 948, in handle File ".../logging/__init__.py", line 1182, in emit File ".../logging/__init__.py", line 1171, in _open NameError: name 'open' is not defined