This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: What are the requirements for a test_sundry-testable script in Tools/scripts?
Type: Stage:
Components: Tests Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: skip.montanaro, zach.ware
Priority: normal Keywords:

Created on 2021-03-25 20:35 by skip.montanaro, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg389526 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2021-03-25 20:35
In my fork of python/cpython I recently created a simple script to help me with my work (I am messing around in the internals and sometimes get blindsided by opcode changes). I stuck the script in Tools/script which caused test_tools.test_sundry to hang. (I suspect it's because my script reads from sys.stdin, but I'm not certain. The old Unix pipeline ways die hard.)

Looking around to see how I could modify my script to make it acceptable to test_sundry, I saw nothing about requirements. I tossed it in the TestSundryScripts.other list and now that test completes. Still, it seems there should be a bit written about what it takes for a script to be amenable to the minimal testing test_sundry.py performs.
msg391162 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2021-04-16 02:55
`test_sundry` just checks to see if the script is importable, so if your script runs on import it may very well cause problems :).  Adding it to a skip list is a reasonable solution, as is making the script import-friendly (e.g. with a `if __name__ == '__main__'` check).
History
Date User Action Args
2022-04-11 14:59:43adminsetgithub: 87793
2021-04-16 02:55:16zach.waresetnosy: + zach.ware
messages: + msg391162
2021-03-25 21:04:49skip.montanarosettitle: What are the requirements for a test_sunry-testable script in Tools/scripts? -> What are the requirements for a test_sundry-testable script in Tools/scripts?
2021-03-25 20:35:30skip.montanarocreate