11
11
from .test_ext_autodoc import do_autodoc
12
12
13
13
IS_PYPY = platform .python_implementation () == 'PyPy'
14
+ IS_PY313_AND_LATER = sys .version_info .major == 3 and sys .version_info .minor >= 13
14
15
15
16
16
17
@contextmanager
@@ -1627,7 +1628,10 @@ def test_autodoc_default_options(app):
1627
1628
assert ' Iterate squares of each value.' in actual
1628
1629
if not IS_PYPY :
1629
1630
assert ' .. py:attribute:: CustomIter.__weakref__' in actual
1630
- assert ' list of weak references to the object (if defined)' in actual
1631
+ if IS_PY313_AND_LATER :
1632
+ assert ' list of weak references to the object' in actual
1633
+ else :
1634
+ assert ' list of weak references to the object (if defined)' in actual
1631
1635
1632
1636
# :exclude-members: None - has no effect. Unlike :members:,
1633
1637
# :special-members:, etc. where None == "include all", here None means
@@ -1651,7 +1655,10 @@ def test_autodoc_default_options(app):
1651
1655
assert ' Iterate squares of each value.' in actual
1652
1656
if not IS_PYPY :
1653
1657
assert ' .. py:attribute:: CustomIter.__weakref__' in actual
1654
- assert ' list of weak references to the object (if defined)' in actual
1658
+ if IS_PY313_AND_LATER :
1659
+ assert ' list of weak references to the object' in actual
1660
+ else :
1661
+ assert ' list of weak references to the object (if defined)' in actual
1655
1662
assert ' .. py:method:: CustomIter.snafucate()' in actual
1656
1663
assert ' Makes this snafucated.' in actual
1657
1664
@@ -1698,7 +1705,10 @@ def test_autodoc_default_options_with_values(app):
1698
1705
assert ' Iterate squares of each value.' in actual
1699
1706
if not IS_PYPY :
1700
1707
assert ' .. py:attribute:: CustomIter.__weakref__' not in actual
1701
- assert ' list of weak references to the object (if defined)' not in actual
1708
+ if IS_PY313_AND_LATER :
1709
+ assert ' list of weak references to the object' in actual
1710
+ else :
1711
+ assert ' list of weak references to the object (if defined)' in actual
1702
1712
1703
1713
# with :exclude-members:
1704
1714
app .config .autodoc_default_options = {
@@ -1722,6 +1732,9 @@ def test_autodoc_default_options_with_values(app):
1722
1732
assert ' Iterate squares of each value.' in actual
1723
1733
if not IS_PYPY :
1724
1734
assert ' .. py:attribute:: CustomIter.__weakref__' not in actual
1725
- assert ' list of weak references to the object (if defined)' not in actual
1735
+ if IS_PY313_AND_LATER :
1736
+ assert ' list of weak references to the object' in actual
1737
+ else :
1738
+ assert ' list of weak references to the object (if defined)' in actual
1726
1739
assert ' .. py:method:: CustomIter.snafucate()' not in actual
1727
1740
assert ' Makes this snafucated.' not in actual
0 commit comments