FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-111735: Fix `turtle.rst` doctests when `tkinter` is not present by sobolevn · Pull Request #111736 · python/cpython · GitHub

Repository navigation

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

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

Conversation

sobolevn commented Nov 4, 2023 •
edited
Loading

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).

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Oh. That's weird :(

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

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

hugovk commented Apr 11, 2024

Copy link
Copy Markdown
Member

@sobolevn Some questions above for you.

serhiy-storchaka added the needs backport to 3.13 only security fixes label May 9, 2024

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?

Copy link
Copy Markdown
Member Author

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 only security fixes skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL