Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_enum_class fails with Python 3.10-beta4 #9442

Closed
befeleme opened this issue Jul 13, 2021 · 0 comments
Closed

test_enum_class fails with Python 3.10-beta4 #9442

befeleme opened this issue Jul 13, 2021 · 0 comments

Comments

@befeleme
Copy link
Contributor

befeleme commented Jul 13, 2021

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.

_______________________________ 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

@tk0miya tk0miya modified the milestones: 4.1.1, 4.1.2 Jul 13, 2021
@tk0miya tk0miya closed this as completed Jul 19, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants