return "false"
elif value is None:
return ""
- elif isinstance(value, (str, float, int)):
- return str(value)
- raise TypeError(
- f"Expected str, int, float, bool, or None. Got {type(value).__name__!r}."
- )
+ return str(value)
def is_known_encoding(encoding: str) -> bool:
assert str(q) == "a="
-def test_invalid_query_params():
- with pytest.raises(
- TypeError, match=r"Expected str, int, float, bool, or None. Got 'bytes'."
- ):
- httpx.QueryParams({"a": b"bytes"})
-
-
def test_queryparam_update_is_hard_deprecated():
q = httpx.QueryParams("a=123")
with pytest.raises(RuntimeError):