Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 96 for raisin (0.17 sec)

  1. tests/test_dependency_contextmanager.py

            client.get("/sync_raise_other")
        assert state["/sync_raise"] == "generator raise finalized"
        assert "/sync_raise" not in errors
    
    
    def test_async_raise_raises():
        with pytest.raises(AsyncDependencyError):
            client.get("/async_raise")
        assert state["/async_raise"] == "asyncgen raise finalized"
        assert "/async_raise" in errors
        errors.clear()
    
    
    def test_async_raise_server_error():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/handling-errors.md

    {!../../../docs_src/handling_errors/tutorial001.py!}
    ```
    
    ### Raise an `HTTPException` in your code
    
    `HTTPException` is a normal Python exception with additional data relevant for APIs.
    
    Because it's a Python exception, you don't `return` it, you `raise` it.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_dependencies/test_tutorial008d_an.py

        with pytest.raises(InternalError) as exc_info:
            client.get("/items/portal-gun")
        assert (
            exc_info.value.args[0] == "The portal gun is too dangerous to be owned by Rick"
        )
    
    
    def test_internal_server_error():
        from docs_src.dependencies.tutorial008d_an import app
    
        client = TestClient(app, raise_server_exceptions=False)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dependencies/test_tutorial008c.py

    
    def test_fastapi_error(client: TestClient):
        with pytest.raises(FastAPIError) as exc_info:
            client.get("/items/portal-gun")
        assert "No response object was returned" in exc_info.value.args[0]
    
    
    def test_internal_server_error():
        from docs_src.dependencies.tutorial008c import app
    
        client = TestClient(app, raise_server_exceptions=False)
        response = client.get("/items/portal-gun")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_dependencies/test_tutorial008c_an.py

    
    def test_fastapi_error(client: TestClient):
        with pytest.raises(FastAPIError) as exc_info:
            client.get("/items/portal-gun")
        assert "No response object was returned" in exc_info.value.args[0]
    
    
    def test_internal_server_error():
        from docs_src.dependencies.tutorial008c_an import app
    
        client = TestClient(app, raise_server_exceptions=False)
        response = client.get("/items/portal-gun")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_dependencies/test_tutorial008c_an_py39.py

    @needs_py39
    def test_fastapi_error(client: TestClient):
        with pytest.raises(FastAPIError) as exc_info:
            client.get("/items/portal-gun")
        assert "No response object was returned" in exc_info.value.args[0]
    
    
    @needs_py39
    def test_internal_server_error():
        from docs_src.dependencies.tutorial008c_an_py39 import app
    
        client = TestClient(app, raise_server_exceptions=False)
        response = client.get("/items/portal-gun")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_dependencies/test_tutorial008d_an_py39.py

        with pytest.raises(InternalError) as exc_info:
            client.get("/items/portal-gun")
        assert (
            exc_info.value.args[0] == "The portal gun is too dangerous to be owned by Rick"
        )
    
    
    @needs_py39
    def test_internal_server_error():
        from docs_src.dependencies.tutorial008d_an_py39 import app
    
        client = TestClient(app, raise_server_exceptions=False)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ### Always `raise` in Dependencies with `yield` and `except`
    
    If you catch an exception in a dependency with `yield`, unless you are raising another `HTTPException` or similar, you should re-raise the original exception.
    
    You can re-raise the same exception using `raise`:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  9. configure.py

          raising an error and quitting.
    
      Returns:
        [String] The value of var_name after querying for input.
    
      Raises:
        UserInputError: if a query has been attempted n_ask_attempts times without
          success, assume that the user has made a scripting error, and will
          continue to provide invalid input. Raise the error to avoid infinitely
          looping.
      """
    Python
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 18:25:36 GMT 2024
    - 53.8K bytes
    - Viewed (0)
  10. tests/test_filter_pydantic_sub_model_pv2.py

            "name": "modelA",
            "description": "model-a-desc",
            "foo": {"username": "test-user"},
        }
    
    
    @needs_pydanticv2
    def test_validator_is_cloned(client: TestClient):
        with pytest.raises(ResponseValidationError) as err:
            client.get("/model/modelX")
        assert err.value.errors() == [
            IsDict(
                {
                    "type": "value_error",
                    "loc": ("response", "name"),
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
Back to top