Skip to content

session_transaction fails because it's calling _update_cookies_from_response with missing arg headers #5107

Closed
@hofrob

Description

@hofrob

I'm re-creating the bug using flask and pytest.

tests/test_session_tx.py

import flask


def test_session_tx():
    app = flask.Flask("test")
    app.config["SECRET_KEY"] = "foo"
    client = app.test_client()
    with client.session_transaction() as session:
        session["bar"] = "baz"
  • install flask, pytest: pip install flask==2.2.4 pytest
  • run pytest tests/test_session_tx.py
        if hasattr(self, "_update_cookies_from_response"):
>           self._update_cookies_from_response(
                ctx.request.host.partition(":")[0], resp.headers.getlist("Set-Cookie")
            )
E           TypeError: Client._update_cookies_from_response() missing 1 required positional argument: 'headers'

venv/lib/python3.11/site-packages/flask/testing.py:171: TypeError

Environment:

  • Python version: 3.11.2
  • Werkzeug version: 2.3.3
  • Flask: 2.2.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions