Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for simplefilter (0.25 sec)

  1. tests/test_generate_unique_id_function.py

        @app.post("/third")
        def post_third(item1: Item):
            return item1  # pragma: nocover
    
        client = TestClient(app)
        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter("always")
            client.get("/openapi.json")
            assert len(w) >= 2
            duplicate_warnings = [
                warning for warning in w if issubclass(warning.category, UserWarning)
            ]
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jan 13 15:10:26 GMT 2024
    - 66.7K bytes
    - Viewed (0)
  2. tests/test_include_router_defaults_overrides.py

        assert not override5 or "x-level5" in response.headers
    
    
    def test_openapi():
        client = TestClient(app)
        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter("always")
            response = client.get("/openapi.json")
            assert issubclass(w[-1].category, UserWarning)
            assert "Duplicate Operation ID" in str(w[-1].message)
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 358.6K bytes
    - Viewed (0)
Back to top