[issue41898] Any logging causes assertLogs to pass

2020-10-05 Thread Irit Katriel
Irit Katriel added the comment: Strike that - Troy has created the new issue 41943 so this one can remain closed. -- ___ Python tracker ___ __

[issue41898] Any logging causes assertLogs to pass

2020-10-05 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: +21560 pull_request: https://github.com/python/cpython/pull/22565 ___ Python tracker ___

[issue41898] Any logging causes assertLogs to pass

2020-10-05 Thread Irit Katriel
Irit Katriel added the comment: Please reopen this issue. I understand after a discussion on stackoverflow what the problem is, and there is indeed a bug. I will create a PR with a unit test for it an a fix. -- ___ Python tracker

[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Irit Katriel
Irit Katriel added the comment: Troy, I'm also confused about how you would have liked assertLogs to behave you say: 1. I don't want to specify the logger because I don't care which logger the message comes from. 2. I don't want it to catch messages from other loggers (whatever other means

[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Irit Katriel
Irit Katriel added the comment: I'm not sure my patch completely resolved this issue. I'm adding Antoine re the OP's question about the assertLogs API. > Doing so would make the test over-specific and fragile. The requirement is > > that a warning be logged, not that a specific logger issu

[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip
Change by Vinay Sajip : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 ___ Python tracker ___ __

[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset faa8c6a8f1fe9c3bac31061e8a59a686b983ebb8 by Miss Skeleton (bot) in branch '3.9': bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526) (GH-22540) https://github.com/python/cpython/commit/faa8c6a8f1fe9c3bac31061e8a59

[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread miss-islington
Change by miss-islington : -- pull_requests: +21543 pull_request: https://github.com/python/cpython/pull/22540 ___ Python tracker ___ __

[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset b2611fac05ed391d68f09781903aae7394fab832 by Miss Skeleton (bot) in branch '3.8': bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526) (GH-22537) https://github.com/python/cpython/commit/b2611fac05ed391d68f09781903a

[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset 1ed54435268b285964141fb74d47ceaa33ea79ab by Irit Katriel in branch 'master': bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526) https://github.com/python/cpython/commit/1ed54435268b285964141fb74d47ceaa33ea79ab

[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +21540 pull_request: https://github.com/python/cpython/pull/22537 ___ Python tracker _

[issue41898] Any logging causes assertLogs to pass

2020-10-04 Thread miss-islington
Change by miss-islington : -- pull_requests: +21541 pull_request: https://github.com/python/cpython/pull/22538 ___ Python tracker ___ __

[issue41898] Any logging causes assertLogs to pass

2020-10-03 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch pull_requests: +21531 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22526 ___ Python tracker ___ ___

[issue41898] Any logging causes assertLogs to pass

2020-10-03 Thread Irit Katriel
Irit Katriel added the comment: You didn't specify the logger in the assertLogs() call. The documentation says that "The default is the root logger, which will catch all messages." https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertLogs This is behaving as expected. -

[issue41898] Any logging causes assertLogs to pass

2020-09-30 Thread Troy Daniels
New submission from Troy Daniels : The following test code unexpectedly passes. import logging import unittest LOG_FORMAT = '%(levelname)-10s %(asctime)s: %(message)s' def set_up_logger(app_name, level=logging.INFO, file="test.log"): formatter = logging.Formatter(LOG_FORMAT) log = lo