Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for assert_called_once_with (0.09 sec)

  1. tests/test_tutorial/test_python_types/test_tutorial009c.py

        return mod
    
    
    def test_say_hi(module: ModuleType):
        with patch("builtins.print") as mock_print:
            module.say_hi("FastAPI")
    
        mock_print.assert_called_once_with("Hey FastAPI!")
    
        with pytest.raises(
            TypeError,
            match=re.escape("say_hi() missing 1 required positional argument: 'name'"),
        ):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 777 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_debugging/test_tutorial001.py

        if sys.modules.get(MOD_NAME):
            del sys.modules[MOD_NAME]
        with unittest.mock.patch("uvicorn.run") as uvicorn_run_mock:
            runpy.run_module(MOD_NAME, run_name="__main__")
    
        uvicorn_run_mock.assert_called_once_with(
            unittest.mock.ANY, host="0.0.0.0", port=8000
        )
    
    
    def test_openapi_schema(client: TestClient):
        response = client.get("/openapi.json")
        assert response.status_code == 200
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.8K bytes
    - Viewed (0)
Back to top