Skip to content

Commit a108baa

Browse files
committed
Adjust the expected string to match Python 3.13.0a2 changed output
1 parent 3596590 commit a108baa

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

tests/test_ext_autodoc_configs.py

+17-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from .test_ext_autodoc import do_autodoc
1212

1313
IS_PYPY = platform.python_implementation() == 'PyPy'
14+
IS_PY313_AND_LATER = sys.version_info.major == 3 and sys.version_info.minor >= 13
1415

1516

1617
@contextmanager
@@ -1627,7 +1628,10 @@ def test_autodoc_default_options(app):
16271628
assert ' Iterate squares of each value.' in actual
16281629
if not IS_PYPY:
16291630
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
16311635

16321636
# :exclude-members: None - has no effect. Unlike :members:,
16331637
# :special-members:, etc. where None == "include all", here None means
@@ -1651,7 +1655,10 @@ def test_autodoc_default_options(app):
16511655
assert ' Iterate squares of each value.' in actual
16521656
if not IS_PYPY:
16531657
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
16551662
assert ' .. py:method:: CustomIter.snafucate()' in actual
16561663
assert ' Makes this snafucated.' in actual
16571664

@@ -1698,7 +1705,10 @@ def test_autodoc_default_options_with_values(app):
16981705
assert ' Iterate squares of each value.' in actual
16991706
if not IS_PYPY:
17001707
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
17021712

17031713
# with :exclude-members:
17041714
app.config.autodoc_default_options = {
@@ -1722,6 +1732,9 @@ def test_autodoc_default_options_with_values(app):
17221732
assert ' Iterate squares of each value.' in actual
17231733
if not IS_PYPY:
17241734
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
17261739
assert ' .. py:method:: CustomIter.snafucate()' not in actual
17271740
assert ' Makes this snafucated.' not in actual

0 commit comments

Comments
 (0)