[issue46126] Unittest output drives developers to avoid docstrings

2022-04-03 Thread miss-islington
miss-islington added the comment: New changeset 84acb5cad1b871bb8729cbf1d036b84cbe1636f0 by Jason R. Coombs in branch 'main': bpo-46126: Restore 'descriptions' when running tests internally. (GH-32128) https://github.com/python/cpython/commit/84acb5cad1b871bb8729cbf1d036b84cbe1636f0

[issue46126] Unittest output drives developers to avoid docstrings

2022-04-03 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +30349 pull_request: https://github.com/python/cpython/pull/32288 ___ Python tracker ___

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Ethan Furman
Ethan Furman added the comment: That makes sense. issue47133 created. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: My goal with this issue is to simply unblock the use of docstrings in Python tests. I believe with the work above and the proposed published post, I've accomplished that goal. I've already spent more time than I'd hoped on this issue and would like to

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Ethan Furman
Ethan Furman added the comment: Perhaps we could make an enhancement then? Having the extra information on a separate line is, at least for me, very jarring -- as in, I hadn't figured out that that was the way it was done until Inadasan pointed it out. Perhaps a command-line switch to

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +30208 pull_request: https://github.com/python/cpython/pull/32128 ___ Python tracker ___

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Jason R. Coombs
Change by Jason R. Coombs : -- resolution: -> works for me ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've confirmed that prior to the patch in PR 30194, the location of the failure was indeed reported. It was just not reported on the same line: ``` cpython main $ git log -1 commit 3e93af0b06cada874c4a16868b6f863b599919f2 (HEAD -> main) Author: Jason R.

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-23 Thread Éric Araujo
Éric Araujo added the comment: I think the situation and the discussion should be summarized on python-dev! -- ___ Python tracker ___

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: And indeed, after removing the `grep ERROR` part of the repro, even the repro seems to be invalid: ``` cpython main $ ./python.exe -m test.test_importlib -v -k test_entry_points_unique test_entry_points_unique_packages

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: Inada, you're right. Good catch. I think I missed that behavior from before because I used `grep ERROR` and when I ran it this time, I just assumed the output would be the same, but it's clear that even _with descriptions enabled_, the location of the test

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-20 Thread Inada Naoki
Inada Naoki added the comment: > As you can see, the location of the failing test in the log is masked, and > instead the description is present. Could you elaborate? ``` test_index_empty (idlelib.idle_test.test_text.MockTextTest) Failing test with bad description. ... ERROR (snip)

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-20 Thread Jason R. Coombs
Jason R. Coombs added the comment: In an attempt to replicate Terry's usage, I added the following patch: ``` diff --git a/Lib/idlelib/idle_test/test_text.py b/Lib/idlelib/idle_test/test_text.py index 0f31179e04..be977bbfff 100644 --- a/Lib/idlelib/idle_test/test_text.py +++

[issue46126] Unittest output drives developers to avoid docstrings

2022-01-22 Thread Jason R. Coombs
Change by Jason R. Coombs : -- assignee: -> jaraco ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46126] Unittest output drives developers to avoid docstrings

2022-01-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've merged the fix for regrtest and I'll explore Terry's concerns and see what I can devise for those concerns as well. -- ___ Python tracker

[issue46126] Unittest output drives developers to avoid docstrings

2022-01-22 Thread miss-islington
miss-islington added the comment: New changeset a941e5927f7f2540946813606c61c6aea38db426 by Jason R. Coombs in branch 'main': bpo-46126: Disable 'descriptions' when running tests internally. (GH-30194) https://github.com/python/cpython/commit/a941e5927f7f2540946813606c61c6aea38db426

[issue46126] Unittest output drives developers to avoid docstrings

2022-01-01 Thread Jason R. Coombs
Jason R. Coombs added the comment: > > I presume I don't need to explain why docstrings are nice and preferable > > over comments. > Actually, can you? I searched around and didn't find any good treatise or thorough overview of reasons _why_ docstrings should be preferred, so I performed

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-24 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: I also use comments in lieu of docstrings for text_xyx methods because I find the addition of the first line of the docstring in error reports to be useless, distracting, and sometimes, depending on the content, confusing. If the error is in the test

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-24 Thread Éric Araujo
Éric Araujo added the comment: > I presume I don't need to explain why docstrings are nice and preferable over > comments. Actually, can you? Docstrings to document regular modules, classes or functions are a fine tool, especially with tools that extract them (pydoc, sphinx). I don’t see

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-18 Thread Jason R. Coombs
Change by Jason R. Coombs : -- keywords: +patch pull_requests: +28415 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30194 ___ Python tracker ___

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-18 Thread Jason R. Coombs
Jason R. Coombs added the comment: After some investigation (and tracing calls through a dozen or more layers), I found that Python's own regression tests can disable this behavior thus: ``` diff --git a/Lib/test/support/testresult.py b/Lib/test/support/testresult.py index

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-18 Thread Jason R. Coombs
Jason R. Coombs added the comment: It looks like that 'descriptions' attribute is passed through from TextTestRunner, which sets it to True by default (https://github.com/python/cpython/blob/9b52920173735ac609664c6a3a3021d24a95a092/Lib/unittest/runner.py#L163). It seems that behavior isn't

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-18 Thread Jason R. Coombs
Jason R. Coombs added the comment: Looks like the code, I believe here's where the reporting happens: https://github.com/python/cpython/blob/9b52920173735ac609664c6a3a3021d24a95a092/Lib/unittest/runner.py#L48-L51 I see a "description" property there that may already provide the feature.

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-18 Thread Jason R. Coombs
Jason R. Coombs added the comment: My guess is the tests were run with something like this: ``` ./python.exe -E -We -m test -v test_importlib | grep '... ERROR' Entry points should only be exposed for the first package ... ERROR test test_importlib failed ``` In that case, the location of

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-18 Thread Jason R. Coombs
Jason R. Coombs added the comment: I created this diff: ```diff diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py index e16773a7e8..92aacd5ad5 100644 --- a/Lib/test/test_importlib/test_metadata_api.py +++

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-18 Thread Jason R. Coombs
Jason R. Coombs added the comment: Absolutely. I was thinking to do just that. -- ___ Python tracker ___ ___ Python-bugs-list

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-18 Thread Ethan Furman
Ethan Furman added the comment: Could you give a couple examples for those of us not familiar with the problem? -- nosy: +ethan.furman ___ Python tracker ___

[issue46126] Unittest output drives developers to avoid docstrings

2021-12-18 Thread Jason R. Coombs
New submission from Jason R. Coombs : In https://github.com/python/importlib_metadata/issues/302, I learned that the way unittest reports failures in tests is incentivizing the replacement of docstrings with comments in order not to make resolution of the relevant failing test more difficult