Skip to content

gh-111735: Fix turtle.rst doctests when tkinter is not present - #111736

Closed
sobolevn wants to merge 2 commits into
python:mainfrom
sobolevn:issue-111735
Closed

gh-111735: Fix turtle.rst doctests when tkinter is not present#111736
sobolevn wants to merge 2 commits into
python:mainfrom
sobolevn:issue-111735

Conversation

@sobolevn

@sobolevn sobolevn commented Nov 4, 2023

Copy link
Copy Markdown
Member

I had to ignore some tests completely, because they seem like asking for user interaction / resourses that are not present (like files / images / etc).

@bedevere-app bedevere-app Bot added awaiting review docs Documentation in the Doc dir skip news labels Nov 4, 2023
@hugovk hugovk added needs backport to 3.10 only security fixes needs backport to 3.12 only security fixes labels Nov 4, 2023
@sobolevn sobolevn added needs backport to 3.11 only security fixes and removed needs backport to 3.10 only security fixes labels Nov 4, 2023
Comment thread Doc/library/turtle.rst
return the filename of the current backgroundimage.

.. doctest::
:skipif: True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should just not add the .. doctest directive here, if we never want sphinx to actually run this REPL snippet as a doctest?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remove this line, there will be an error locally. I don't know why, I have no idea how to debug this kind of problems.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. That's weird :(

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appear to have left these questions/change-requests? 'pending'.

Comment thread Doc/library/turtle.rst
Comment on lines 12 to 16
.. testsetup:: default
:skipif: _tkinter is None

from turtle import *
turtle = Turtle()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the directive is only 'seen' by sphinx, doctest.testfile fails miserably on this file (326 of 337). It seems that this file was never meant to be doctested. Can one make the directive global instead of local.

If the 2 lines were given as examples of how to minimally start (>>> import, >>> turtle =) as would seem sensible, then I believe tests would run. But I understand that you are not intending to edit content.

Comment thread Doc/library/turtle.rst
turtle is headed. Do not change the turtle's heading.

.. doctest::
:skipif: _tkinter is None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since elsewhere the directly seems to apply to multiple test without intervening text (correct?), I believe addition makes the directive on 380-1 obsolete.

Comment thread Doc/library/turtle.rst

.. doctest::
:skipif: _tkinter is None
:hide:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does doctest really fail on blank output? Or what does :hide: do?

@hugovk hugovk removed the needs backport to 3.11 only security fixes label Apr 11, 2024
@hugovk

hugovk commented Apr 11, 2024

Copy link
Copy Markdown
Member

@sobolevn Some questions above for you.

@serhiy-storchaka serhiy-storchaka added the needs backport to 3.13 bugs and security fixes label May 9, 2024
@hugovk

hugovk commented Oct 24, 2024

Copy link
Copy Markdown
Member

Hello from +1 year 👋

Where are we up to with this? Can we close it?

@sobolevn

Copy link
Copy Markdown
Member Author

Yeah, I lost context of this a long time ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants