You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
arhadthedev
changed the title
Using modules via python -m also should be tested
Not only module imports should be tested, but python -m too
May 9, 2022
That would be a policy change. Generally, these sections are for internal use and not part of the public API. If someone really cared about _perfcheck(), the would have tested that function directly. One other thought it that some main sections take arguments, so it stops being a trivial matter to exercise them fully.
Thank you for clarification on non-public status of the script sections. However, I've got a question to remove such a confusion for future others:
Generally, these sections are for internal use and not part of the public API
If they are exclusively for CPython developers and contributors, will it be better to strip them from user-deployed modules and put into a dev-only Tools/? Except for really useful tools like tabnanny (with documented "For the time being this module is intended to be called as a script") that can be granted a public, properly documented argparse-based CLI?
Currently all (of the most of, need verification) modules are tested for
import
s only.However,
if __name__ == "__main__"
path needs to be tested as well to avoid bugs like gh-92546 (reported for 3.10 but also affects 3.11b1).The text was updated successfully, but these errors were encountered: