-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
gh-131178: add unittest for turtledemo #139983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
d4e86b8 to
e835630
Compare
StanFromIreland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you creating a faux unittest? Please use the actual module, I suggest you look at the many other tests in Lib/test/.
fe53817 to
7f8ce74
Compare
- Clean up trailing spaces on all lines - Maintain proper code formatting and readability - All tests continue to pass successfully
7f8ce74 to
d1196ec
Compare
|
I am closing this. The immediate problem with the proposed tests is that they catch assert failures and then fail. This is not how unittests should be written. The bigger problem is that turtledemo is not a library module. It is a GUI app that serves as dynamic documentation of turtle library features. Its command line interface is empty in the sense that there are no command line options to test. But the minimal CLI of running the file is not tested -- and should not be. Testing library module CLIs meaning running the module with various arguments and testing that the stdout and possibly stderr output matches expectations. Turtledemo has instead an interactive user interface. Running it displays the GUI app, which then waits for user mouse clicks. There is no text output and would be no graceful way to close it from a unittest. Testing a GUI is entirely different from testing a CLI, and turtledemo is not designed for automated unit testing. It has to be manually tested, which I have done extensively. Anyone touching it should do the same. |
gh-131178: add unittest for turtledemo command line interface