[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-04-23 Thread Kit Yan Choi
Kit Yan Choi added the comment: Thank you for looking into this. Yes, I agree it makes sense to have assertNoWarns for the same reason. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-01-19 Thread Kit Yan Choi
Change by Kit Yan Choi : -- keywords: +patch pull_requests: +17459 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18067 ___ Python tracker <https://bugs.python.org/issu

[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-01-18 Thread Kit Yan Choi
New submission from Kit Yan Choi : assertLogs is really useful (issue18937). Unfortunately it does not cover the use cases where one wants to ensure no logs are emitted. Similar to assertLogs, we can have a context manager for asserting no logs, something like this?: with assertNoLogs

[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-28 Thread Kit Yan Choi
Kit Yan Choi added the comment: I think Python does differentiate "test error" and "test failure" such that a test outcome state can be one of these: success, failure, error, skipped. One could refine these to six: expected success, unexpected success, expected failure

[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-28 Thread Kit Yan Choi
Kit Yan Choi added the comment: Pining Chris based on previous discussion in issue16997 ... Hope that's okay. I notice that the language in my initial message also conflates error and failure. My apologies on the carelessness. Just to clarify: @unittest.expectedFailure def test

[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-27 Thread Kit Yan Choi
Change by Kit Yan Choi : -- nosy: -Kit Choi ___ Python tracker <https://bugs.python.org/issue38296> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-27 Thread Kit Yan Choi
Kit Yan Choi added the comment: For your test: class T(unittest.TestCase): def test_f(self): raise TypeError() If you run this test with unittest test runner, you should get this result: E == ERROR: test_f (test_main.T

[issue30724] ZipFile.open treats directory path as empty file

2017-06-21 Thread Kit Yan Choi
New submission from Kit Yan Choi: Given a zipfile with the following content: subdir/ file1.txt subdir/file2.txt >>> archive = ZipFile(file_path, "r") >>> f = archive.open("subdir/", "r") >>>f.read() b'' It is quite odd