Skip to content

gh-135272: Activate doctests on turtle module#138877

Draft
adorilson wants to merge 2 commits intopython:mainfrom
adorilson:gh-135272_activate_doctests_on_turtle
Draft

gh-135272: Activate doctests on turtle module#138877
adorilson wants to merge 2 commits intopython:mainfrom
adorilson:gh-135272_activate_doctests_on_turtle

Conversation

@adorilson
Copy link
Copy Markdown
Contributor

@adorilson adorilson commented Sep 13, 2025

This PR is a WIP to fix #135272

I'd like reviews and comments before I continue.

Also, I need some help:

  1. I added a load_tests function to include doctests in unittest, and already fixed some ERRORs on tests (8 remaining), the majority were just adding import turtle and instantiating a turtle object. Is it possible to avoid repeating it in every doctest?

  2. I mocked the mainloop function. But maybe it was the right way. How is it?

  3. Any recommendations about how to mock other functions that wait for a user action (num/textinput, ...)?

  4. The optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE, options seem not to work properly. For instance, (0,0) is saw different of (0, 0) (common on tests with position()). (Or I did understand how these options work.

This PR is related to #111704

@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create tests for turtle module

3 participants