You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Enum behavior was changed in Python 3.10-beta 4 to be the same as in Python 3.9. The changes to behavior are postponed to Python 3.11. When changes to Enum were reverted, the test started to fail.
Changing the condition to if sys.version_info < (3, 11) seems to solve the problem.
_______________________________ test_enum_class ________________________________
app = <SphinxTestApp buildername='html'>
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_enum_class(app):
options = {"members": None}
actual = do_autodoc(app, 'class', 'target.enums.EnumCls', options)
if sys.version_info < (3, 10):
sig = '(value)'
else:
sig = ('(value, names=None, *, module=None, qualname=None, type=None, start=1, '
'boundary=None)')
> assert list(actual) == [
'',
'.. py:class:: EnumCls%s' % sig,
' :module: target.enums',
'',
' this is enum class',
'',
'',
' .. py:method:: EnumCls.say_goodbye()',
' :module: target.enums',
' :classmethod:',
'',
' a classmethod says good-bye to you.',
'',
'',
' .. py:method:: EnumCls.say_hello()',
' :module: target.enums',
'',
' a method says hello to you.',
'',
'',
' .. py:attribute:: EnumCls.val1',
' :module: target.enums',
' :value: 12',
'',
' doc for val1',
'',
'',
' .. py:attribute:: EnumCls.val2',
' :module: target.enums',
' :value: 23',
'',
' doc for val2',
'',
'',
' .. py:attribute:: EnumCls.val3',
' :module: target.enums',
' :value: 34',
'',
' doc for val3',
'',
]
E AssertionError: assert ['', '.. py:c...ass', '', ...] == ['', '.. py:c...ass', '', ...]
E At index 1 diff: '.. py:class:: EnumCls(value)' != '.. py:class:: EnumCls(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)'
E Use -v to get the full diff
tests/test_ext_autodoc.py:1380: AssertionError
How to Reproduce
pytest tests/test_ext_autodoc.py
Expected behavior
The test shall pass.
Your project
RPM package in Fedora
Screenshots
No response
OS
Fedora Rawhide (35)
Python version
3.10-beta4
Sphinx version
4.1.0
Sphinx extensions
No response
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
The Enum behavior was changed in Python 3.10-beta 4 to be the same as in Python 3.9. The changes to behavior are postponed to Python 3.11. When changes to Enum were reverted, the test started to fail.
Changing the condition to
if sys.version_info < (3, 11)
seems to solve the problem.How to Reproduce
pytest tests/test_ext_autodoc.py
Expected behavior
The test shall pass.
Your project
RPM package in Fedora
Screenshots
No response
OS
Fedora Rawhide (35)
Python version
3.10-beta4
Sphinx version
4.1.0
Sphinx extensions
No response
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: