Skip to content

Replace funcargnames with fixturenames #1015

@mawilliam

Description

@mawilliam

The funcargnames attribute has been deprecated in favor of fixturenames since pytest 6.1. I received the following exception:

_______________ ERROR at setup of test_recurrence_end_count[1-1] _______________

request = <SubRequest '_live_server_helper' for <Function test_recurrence_end_count[1-1]>>

    @pytest.fixture(autouse=True, scope='function')
    def _live_server_helper(request):
        """Helper to make live_server work, internal to pytest-django.
    
        This helper will dynamically request the transactional_db fixture
        for a test which uses the live_server fixture.  This allows the
        server and test to access the database without having to mark
        this explicitly which is handy since it is usually required and
        matches the Django behaviour.
    
        The separate helper is required since live_server can not request
        transactional_db directly since it is session scoped instead of
        function-scoped.
        """
>       if 'live_server' in request.funcargnames:
E       AttributeError: 'SubRequest' object has no attribute 'funcargnames'

There are still four instances of it being used in the fixtures.py module including the one referenced in my exception. Updating that attribute reference fixed my error.

I am using Python 3.7 and pytest-django 3.1.2 on Mac Monterey version 12.3.1.

Please let me know if you need anything else. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions