← mined_baseline

fastapi_9783

failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · fastapi/fastapi

Task input

(not found in data/tasks.jsonl)

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Test output

show
.....F
=================================== FAILURES ===================================
___________ test_strict_login_incorrect_grant_type[incorrect value] ____________

grant_type = 'incorrect'

    @pytest.mark.parametrize(
        argnames=["grant_type"],
        argvalues=[
            pytest.param("incorrect", id="incorrect value"),
            pytest.param("passwordblah", id="password with suffix"),
            pytest.param("blahpassword", id="password with prefix"),
        ],
    )
    def test_strict_login_incorrect_grant_type(grant_type: str):
        response = client.post(
            "/login",
            data={"username": "johndoe", "password": "secret", "grant_type": grant_type},
        )
        assert response.status_code == 422
>       assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "string_pattern_mismatch",
                        "loc": ["body", "grant_type"],
                        "msg": "String should match pattern '^password$'",
                        "input": grant_type,
                        "ctx": {"pattern": "^password$"},
                    }
                ]
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
                "detail": [
                    {
                        "loc": ["body", "grant_type"],
                        "msg": 'string does not match regex "^password$"',
                        "type": "value_error.str.regex",
                        "ctx": {"pattern": "^password$"},
                    }
                ]
            }
        )
E       assert {'detail': [{'type': 'string_pattern_mismatch', 'loc': ['body', 'grant_type'], 'msg': "String should match pattern 'password'", 'input': 'incorrect', ...}]} == (IsDict(detail=[{'type': 'string_pattern_mismatch', 'loc': ['body', 'grant_type'], 'msg': "String should match pattern '^password$'", 'input': 'incorrect', 'ctx': {'pattern': '^password$'}}]) | IsDict(detail=[{'loc': ['body', 'grant_type'], 'msg': 'string does not match regex "^password$"', 'type': 'value_error.str.regex', 'ctx': {'pattern': '^password$'}}]))
E        +  where {'detail': [{'type': 'string_pattern_mismatch', 'loc': ['body', 'grant_type'], 'msg': "String should match pattern 'password'", 'input': 'incorrect', ...}]} = json()
E        +    where json = <Response [422 Unprocessable Entity]>.json
E        +  and   IsDict(detail=[{'type': 'string_pattern_mismatch', 'loc': ['body', 'grant_type'], 'msg': "String should match pattern '^password$'", 'input': 'incorrect', 'ctx': {'pattern': '^password$'}}]) = IsDict({'detail': [{'type': 'string_pattern_mismatch', 'loc': ['body', 'grant_type'], 'msg': "String should match pattern '^password$'", 'input': 'incorrect', ...}]})
E        +  and   IsDict(detail=[{'loc': ['body', 'grant_type'], 'msg': 'string does not match regex "^password$"', 'type': 'value_error.str.regex', 'ctx': {'pattern': '^password$'}}]) = IsDict({'detail': [{'loc': ['body', 'grant_type'], 'msg': 'string does not match regex "^password$"', 'type': 'value_error.str.regex', 'ctx': {'pattern': '^password$'}}]})

tests/test_security_oauth2.py:155: AssertionError
=============================== warnings summary ===============================
../../../../../../Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/overlays/starlette-0.45.3-py3-none-any/starlette/testclient.py:36
  /Users/jp/repos/kaggle-gemini-coding-agent-post-training/.envs/overlays/starlette-0.45.3-py3-none-any/starlette/testclient.py:36: DeprecationWarning: The anyio.abc.BlockingPortal alias is deprecated, use anyio.from_thread.BlockingPortal instead.
    _PortalFactoryType = typing.Callable[[], typing.ContextManager[anyio.abc.BlockingPortal]]

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed, 5 passed, 1 warning in 0.58s