https://github.com/python/cpython/commit/f8a703ab3e70c131d44253ba1c3ba005664abb31
commit: f8a703ab3e70c131d44253ba1c3ba005664abb31
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2026-08-27T14:01:39Z
summary:

[3.14] gh-111735: Skip `turtle` doctests when `_tkinter` is not available 
(GH-156417) (#156471)

Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Doc/library/turtle.rst

diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst
index c694077b22f51f..ec5cdd4c111cbb 100644
--- a/Doc/library/turtle.rst
+++ b/Doc/library/turtle.rst
@@ -10,11 +10,13 @@
 **Source code:** :source:`Lib/turtle.py`
 
 .. testsetup:: default
+   :skipif: _tkinter is None
 
    from turtle import *
    turtle = Turtle()
 
 .. testcleanup::
+   :skipif: _tkinter is None
 
    import os
    os.remove("my_drawing.ps")
@@ -509,6 +511,7 @@ Turtle motion
    turtle is headed.  Do not change the turtle's heading.
 
    .. doctest::
+      :skipif: _tkinter is None
       :hide:
 
       >>> turtle.goto(0, 0)
@@ -851,6 +854,7 @@ Turtle motion
    last *n* stamps.
 
    .. doctest::
+      :skipif: _tkinter is None
 
       >>> for i in range(8):
       ...     unused_stamp_id = turtle.stamp()
@@ -1408,8 +1412,11 @@ More drawing control
    font.  If *move* is true, the pen is moved to the bottom-right corner of the
    text.  By default, *move* is ``False``.
 
-   >>> turtle.write("Home = ", True, align="center")
-   >>> turtle.write((0,0), True)
+   .. doctest::
+      :skipif: _tkinter is None
+
+      >>> turtle.write("Home = ", True, align="center")
+      >>> turtle.write((0,0), True)
 
 
 Turtle state
@@ -1446,12 +1453,15 @@ Visibility
 
    Return ``True`` if the Turtle is shown, ``False`` if it's hidden.
 
-   >>> turtle.hideturtle()
-   >>> turtle.isvisible()
-   False
-   >>> turtle.showturtle()
-   >>> turtle.isvisible()
-   True
+   .. doctest::
+      :skipif: _tkinter is None
+
+      >>> turtle.hideturtle()
+      >>> turtle.isvisible()
+      False
+      >>> turtle.showturtle()
+      >>> turtle.isvisible()
+      True
 
 
 Appearance
@@ -1982,6 +1992,9 @@ Window control
    method, one can make visible those parts of a drawing which were outside the
    canvas before.
 
+   .. doctest::
+      :skipif: _tkinter is None
+
       >>> screen.screensize()
       (400, 300)
       >>> screen.screensize(2000,1500)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to