gh-111735: Fix turtle.rst doctests when tkinter is not present - #111736
gh-111735: Fix turtle.rst doctests when tkinter is not present#111736sobolevn wants to merge 2 commits into
turtle.rst doctests when tkinter is not present#111736Conversation
| return the filename of the current backgroundimage. | ||
|
|
||
| .. doctest:: | ||
| :skipif: True |
There was a problem hiding this comment.
Maybe we should just not add the .. doctest directive here, if we never want sphinx to actually run this REPL snippet as a doctest?
There was a problem hiding this comment.
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.
terryjreedy
left a comment
There was a problem hiding this comment.
I appear to have left these questions/change-requests? 'pending'.
| .. testsetup:: default | ||
| :skipif: _tkinter is None | ||
|
|
||
| from turtle import * | ||
| turtle = Turtle() |
There was a problem hiding this comment.
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.
| turtle is headed. Do not change the turtle's heading. | ||
|
|
||
| .. doctest:: | ||
| :skipif: _tkinter is None |
There was a problem hiding this comment.
Since elsewhere the directly seems to apply to multiple test without intervening text (correct?), I believe addition makes the directive on 380-1 obsolete.
|
|
||
| .. doctest:: | ||
| :skipif: _tkinter is None | ||
| :hide: |
There was a problem hiding this comment.
Does doctest really fail on blank output? Or what does :hide: do?
|
@sobolevn Some questions above for you. |
|
Hello from +1 year 👋 Where are we up to with this? Can we close it? |
|
Yeah, I lost context of this a long time ago. |
I had to ignore some tests completely, because they seem like asking for user interaction / resourses that are not present (like files / images / etc).
Doc/library/turtle.rstdoctests are failing whentkinteris not present #111735