Test Client - TestClient
¶
You can use the TestClient
class to test FastAPI applications without creating an actual HTTP and socket connection, just communicating directly with the FastAPI code.
Read more about it in the FastAPI docs for Testing.
You can import it directly from fastapi.testclient
:
from fastapi.testclient import TestClient
fastapi.testclient.TestClient
¶
TestClient(<span data-autorefs-optional="fastapi.testclient.TestClient(app)">app</span>, <span data-autorefs-optional="fastapi.testclient.TestClient(base_url)">base_url</span>='http://testserver', <span data-autorefs-optional="fastapi.testclient.TestClient(raise_server_exceptions)">raise_server_exceptions</span>=True, <span data-autorefs-optional="fastapi.testclient.TestClient(root_path)">root_path</span>='', <span data-autorefs-optional="fastapi.testclient.TestClient(backend)">backend</span>='asyncio', <span data-autorefs-optional="fastapi.testclient.TestClient(backend_options)">backend_options</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient(follow_redirects)">follow_redirects</span>=True)
Bases: Client
PARAMETER | DESCRIPTION |
---|---|
app
|
TYPE:
|
base_url
|
TYPE:
|
raise_server_exceptions
|
TYPE:
|
root_path
|
TYPE:
|
backend
|
TYPE:
|
backend_options
|
TYPE:
|
cookies
|
TYPE:
|
headers
|
TYPE:
|
follow_redirects
|
TYPE:
|
Source code in starlette/testclient.py
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 |
|
auth
property
writable
¶
auth
Authentication class used when none is passed at the request-level.
See also Authentication.
async_backend
instance-attribute
¶
async_backend = _AsyncBackend(
backend=backend, backend_options=backend_options or {}
)
build_request
¶
build_request(<span data-autorefs-optional="fastapi.testclient.TestClient.build_request(method)">method</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(content)">content</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(data)">data</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(files)">files</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(json)">json</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.build_request(extensions)">extensions</span>=None)
Build and return a request instance.
- The
params
,headers
andcookies
arguments are merged with any values set on the client. - The
url
argument is merged with anybase_url
set on the client.
See also: Request instances
PARAMETER | DESCRIPTION |
---|---|
method
|
TYPE:
|
url
|
TYPE:
|
content
|
TYPE:
|
data
|
TYPE:
|
files
|
TYPE:
|
json
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
Source code in httpx/_client.py
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
stream
¶
stream(<span data-autorefs-optional="fastapi.testclient.TestClient.stream(method)">method</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(content)">content</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(data)">data</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(files)">files</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(json)">json</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(follow_redirects)">follow_redirects</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.stream(extensions)">extensions</span>=None)
Alternative to httpx.request()
that streams the response body
instead of loading it into memory at once.
Parameters: See httpx.request
.
See also: Streaming Responses
PARAMETER | DESCRIPTION |
---|---|
method
|
TYPE:
|
url
|
TYPE:
|
content
|
TYPE:
|
data
|
TYPE:
|
files
|
TYPE:
|
json
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
YIELDS | DESCRIPTION |
---|---|
Response
|
|
Source code in httpx/_client.py
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 |
|
send
¶
send(<span data-autorefs-optional="fastapi.testclient.TestClient.send(request)">request</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.send(stream)">stream</span>=False, <span data-autorefs-optional="fastapi.testclient.TestClient.send(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.send(follow_redirects)">follow_redirects</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>)
Send a request.
The request is sent as-is, unmodified.
Typically you'll want to build one with Client.build_request()
so that any client-level configuration is merged into the request,
but passing an explicit httpx.Request()
is supported as well.
See also: Request instances
PARAMETER | DESCRIPTION |
---|---|
request
|
TYPE:
|
stream
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
Source code in httpx/_client.py
868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 |
|
close
¶
close()
Close transport and proxies.
Source code in httpx/_client.py
1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 |
|
request
¶
request(<span data-autorefs-optional="fastapi.testclient.TestClient.request(method)">method</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.request(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.request(content)">content</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.request(data)">data</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.request(files)">files</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.request(json)">json</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.request(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.request(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.request(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.request(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.request(follow_redirects)">follow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.request(allow_redirects)">allow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.request(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.request(extensions)">extensions</span>=None)
PARAMETER | DESCRIPTION |
---|---|
method
|
TYPE:
|
url
|
TYPE:
|
content
|
TYPE:
|
data
|
TYPE:
|
files
|
TYPE:
|
json
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
allow_redirects
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
Source code in starlette/testclient.py
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 |
|
get
¶
get(<span data-autorefs-optional="fastapi.testclient.TestClient.get(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.get(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.get(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.get(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.get(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.get(follow_redirects)">follow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.get(allow_redirects)">allow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.get(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.get(extensions)">extensions</span>=None)
PARAMETER | DESCRIPTION |
---|---|
url
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
allow_redirects
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
Source code in starlette/testclient.py
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 |
|
options
¶
options(<span data-autorefs-optional="fastapi.testclient.TestClient.options(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.options(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.options(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.options(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.options(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.options(follow_redirects)">follow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.options(allow_redirects)">allow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.options(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.options(extensions)">extensions</span>=None)
PARAMETER | DESCRIPTION |
---|---|
url
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
allow_redirects
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
Source code in starlette/testclient.py
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 |
|
head
¶
head(<span data-autorefs-optional="fastapi.testclient.TestClient.head(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.head(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.head(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.head(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.head(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.head(follow_redirects)">follow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.head(allow_redirects)">allow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.head(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.head(extensions)">extensions</span>=None)
PARAMETER | DESCRIPTION |
---|---|
url
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
allow_redirects
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
Source code in starlette/testclient.py
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 |
|
post
¶
post(<span data-autorefs-optional="fastapi.testclient.TestClient.post(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.post(content)">content</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.post(data)">data</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.post(files)">files</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.post(json)">json</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.post(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.post(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.post(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.post(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.post(follow_redirects)">follow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.post(allow_redirects)">allow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.post(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.post(extensions)">extensions</span>=None)
PARAMETER | DESCRIPTION |
---|---|
url
|
TYPE:
|
content
|
TYPE:
|
data
|
TYPE:
|
files
|
TYPE:
|
json
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
allow_redirects
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
Source code in starlette/testclient.py
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 |
|
put
¶
put(<span data-autorefs-optional="fastapi.testclient.TestClient.put(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.put(content)">content</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.put(data)">data</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.put(files)">files</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.put(json)">json</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.put(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.put(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.put(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.put(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.put(follow_redirects)">follow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.put(allow_redirects)">allow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.put(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.put(extensions)">extensions</span>=None)
PARAMETER | DESCRIPTION |
---|---|
url
|
TYPE:
|
content
|
TYPE:
|
data
|
TYPE:
|
files
|
TYPE:
|
json
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
allow_redirects
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
Source code in starlette/testclient.py
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 |
|
patch
¶
patch(<span data-autorefs-optional="fastapi.testclient.TestClient.patch(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(content)">content</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(data)">data</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(files)">files</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(json)">json</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(follow_redirects)">follow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(allow_redirects)">allow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.patch(extensions)">extensions</span>=None)
PARAMETER | DESCRIPTION |
---|---|
url
|
TYPE:
|
content
|
TYPE:
|
data
|
TYPE:
|
files
|
TYPE:
|
json
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
allow_redirects
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
Source code in starlette/testclient.py
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 |
|
delete
¶
delete(<span data-autorefs-optional="fastapi.testclient.TestClient.delete(url)">url</span>, *, <span data-autorefs-optional="fastapi.testclient.TestClient.delete(params)">params</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.delete(headers)">headers</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.delete(cookies)">cookies</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.delete(auth)">auth</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.delete(follow_redirects)">follow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.delete(allow_redirects)">allow_redirects</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.delete(timeout)">timeout</span>=<span data-autorefs-optional-hover="httpx._client.USE_CLIENT_DEFAULT">USE_CLIENT_DEFAULT</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.delete(extensions)">extensions</span>=None)
PARAMETER | DESCRIPTION |
---|---|
url
|
TYPE:
|
params
|
TYPE:
|
headers
|
TYPE:
|
cookies
|
TYPE:
|
auth
|
TYPE:
|
follow_redirects
|
TYPE:
|
allow_redirects
|
TYPE:
|
timeout
|
TYPE:
|
extensions
|
TYPE:
|
Source code in starlette/testclient.py
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 |
|
websocket_connect
¶
websocket_connect(<span data-autorefs-optional="fastapi.testclient.TestClient.websocket_connect(url)">url</span>, <span data-autorefs-optional="fastapi.testclient.TestClient.websocket_connect(subprotocols)">subprotocols</span>=None, <span data-autorefs-optional="fastapi.testclient.TestClient.websocket_connect(**kwargs)">**kwargs</span>)
PARAMETER | DESCRIPTION |
---|---|
url
|
TYPE:
|
subprotocols
|
TYPE:
|
**kwargs
|
TYPE:
|
Source code in starlette/testclient.py
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 |
|
lifespan
async
¶
lifespan()
Source code in starlette/testclient.py
775 776 777 778 779 780 |
|
wait_startup
async
¶
wait_startup()
Source code in starlette/testclient.py
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 |
|
wait_shutdown
async
¶
wait_shutdown()
Source code in starlette/testclient.py
799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 |
|