| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
In idlelib.idle_test, test_xyz.py files should end with
```
if __name__ == '__main__':
unittest.main(verbosity=2, exit=0)
```
5 files add the possibly confusing `exit=2` ("why?"),
which is equivalent to the default `exit=True`.
4 files add `exit=False`. This is also nonsensical when there
is nothing more to run; main will immediately exit anyway.
When running the test from an IDLE editor, this argument
has no visible effect. However, A Claude-based
bug finder claims that in other circumstances (such as a program running
the test in a shell), the good test may falsely fail. Even if this is
not true, it can only confuse a reader.
|
Thanks @terryjreedy for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
Sorry, something went wrong.
|
GH-156251 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
|
GH-156252 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
|
GH-156253 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot AMD64 Fedora Stable Clang 3.x (tier-2) has failed when building commit c20318b. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/#/builders/441/builds/10297 Summary of the results of the build (if available): Click to see traceback logsNote: switching to 'c20318bf09e59946f805ace2bd15f70524009edc'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at c20318bf09e59 gh-155648: In IDLE tests, call unittest.main without exit arg (#156249)
Switched to and reset branch 'main'
ar: unable to copy file 'libpython3.16d.a'; reason: No space left on device
make: *** [Makefile:1164: libpython3.16d.a] Error 1 |
Sorry, something went wrong.
…H-156249) (#156253) gh-155648: In IDLE tests, call unittest.main without exit arg (GH-156249) * gh-155648: In IDLE tests, call unittest.main without exit arg DD bug 73: In idlelib.idle_test, test_xyz.py files should end with if __name__ == '__main__': unittest.main(verbosity=2) The default exit is True. This need not and should not be added. 5 files add the confusing equivalent exit=2 ("why the weird value?"), 4 files add exit=False. This is nonsensical when there is nothing more to run; main will immediately exit anyway. When running a test file from an IDLE editor, this argument has no visible effect. However, a Claude-based bug finder claims that in other circumstances (such as a program running the test in a shell), the good test may falsely fail. Even if this is not true, it can only confuse a reader. (The only place in idlelib for exit=False is in idlelib/abc.py files where the unittest is followed by an htest. The default exit=True exits the process, skipping the htest.) As part of editing the discussion of this in idle_test/htest.py, I clarified other things. (cherry picked from commit c20318b) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…H-156249) (#156252) gh-155648: In IDLE tests, call unittest.main without exit arg (GH-156249) * gh-155648: In IDLE tests, call unittest.main without exit arg DD bug 73: In idlelib.idle_test, test_xyz.py files should end with if __name__ == '__main__': unittest.main(verbosity=2) The default exit is True. This need not and should not be added. 5 files add the confusing equivalent exit=2 ("why the weird value?"), 4 files add exit=False. This is nonsensical when there is nothing more to run; main will immediately exit anyway. When running a test file from an IDLE editor, this argument has no visible effect. However, a Claude-based bug finder claims that in other circumstances (such as a program running the test in a shell), the good test may falsely fail. Even if this is not true, it can only confuse a reader. (The only place in idlelib for exit=False is in idlelib/abc.py files where the unittest is followed by an htest. The default exit=True exits the process, skipping the htest.) As part of editing the discussion of this in idle_test/htest.py, I clarified other things. (cherry picked from commit c20318b) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…H-156249) (#156251) DevDanzin bug 73: In idlelib.idle_test, test_xyz.py files should end with if __name__ == '__main__': unittest.main(verbosity=2) The default exit is True. This need not and should not be added. 5 files add the confusing equivalent exit=2 ("why the weird value?"), 4 files add exit=False. This is nonsensical when there is nothing more to run; main will immediately exit anyway. When running a test file from an IDLE editor, this argument has no visible effect. However, a Claude-based bug finder claims that in other circumstances (such as a program running the test in a shell), the good test may falsely fail. Even if this is not true, it can only confuse a reader. (The only place in idlelib for exit=False is in idlelib/abc.py files where the unittest is followed by an htest. The default exit=True exits the process, skipping the htest.) As part of editing the discussion of this in idle_test/htest.py, I clarified other things. (cherry picked from commit c20318b) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
| Back | FazBrowse Home | New Git URL |
DD bug 73: In idlelib.idle_test, test_xyz.py files should end with
if __name__ == '__main__': unittest.main(verbosity=2)The default exit is True. This need not and should not be added.
5 files add the confusing equivalent exit=2 ("why the weird value?"),
4 files add exit=False. This is nonsensical when there is nothing more to run;
main will immediately exit anyway. When running a test file from an IDLE editor,
this argument has no visible effect. However, a Claude-based
bug finder claims that in other circumstances (such as a program running
the test in a shell), the good test may falsely fail. Even if this is
not true, it can only confuse a reader.
(The only place in idlelib for exit=False is in idlelib/abc.py files where the unittest
is followed by an htest. The default exit=True exits the process, skipping the htest.)
As part of editing the discussion of this in idle_test/htest.py, I clarified other things.