コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 9 of about 9 for tests (0.005 sec.)
Async Tests 12276
Async Tests Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You have already seen how to test your FastAPI applications using the provided TestClient . Up to now, ... you have only seen how to write synchronous tests, without using async functions. Being able to use asynchronous functions in your tests could be useful, for example, when ... you're querying your database asynchronously. Imagine you want to test sending requests to your FastAPI application and then verify that your backend successfully wrote the correct data in the d ... abase library. Let's look at how we can make that work. pytest.mark.anyio If we want to call asynchronous functions in our tests, our test functions have to be asynchronous. AnyIO provides a neat plugin for this, that allows us to specify that some te ...
https://man.mtool.work/fastapi/0.115/advanced/async-tests/
Release Notes 11989
Release Notes Latest Changes 0.115.11 Fixes ? Add docs examples and tests (support) for Annotated custom validations, like AfterValidator , revert #13440 . PR #13442 by @tiangolo . New docs: Query Parameters and String Validations - Custom ... s ? Ensure that HTTPDigest only raises an exception when auto_error is True . PR #2939 by @arthurio . Refactors ✅ Simplify tests for query_params_str_validations . PR #13218 by @alv2017 . ✅ Simplify tests for app_testing . PR #13220 by @alv2017 . ✅ Si ... mplify tests for dependency_testing . PR #13223 by @alv2017 . Docs ? Update sponsors: CodeRabbit logo. PR #13424 by @tiangolo . ? Unify ... sian translation for docs/ru/docs/advanced/websockets.md . PR #13279 by @Rishat-F . Internal ✅ Fix a minor bug in the test tests/test_modules_same_name_body/test_main.py . PR #13411 by @alv2017 . ? Use wrangler-action v3. PR #13415 by @joakimnordling ...
https://man.mtool.work/fastapi/0.115/release-notes/
Repository Management Tasks 9131
Repository Management Tasks These are the tasks that can be performed to manage the FastAPI repository by team members . Tip This section is useful only to a handful of people, team members with permissions to manage the repository. You can ... , 3.9, 3.10, there should be different versions of the file, and they should be shown in tabs in the docs. There should be tests testing the source example. Before the PR is applied, the new tests should fail. After applying the PR, the new tests shou ... e, or we discussed it and considered it should be accepted, you can add commits on top of the PR to tweak it, to add docs, tests, format, refactor, remove extra files, etc. Feel free to comment in the PR to ask for more information, to suggest changes ... ery month, a GitHub Action updates the FastAPI People data. Those PRs look like this one: ? Update FastAPI People . If the tests are passing, you can merge it right away. External Links PRs When people add external links they edit this file external_l ...
https://man.mtool.work/fastapi/0.115/management-tasks/
Testing Dependencies with Overrides 8825
Testing Dependencies with Overrides Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Overriding dependencies during testing There are some scenarios where you might ... of the sub-dependencies it might have). Instead, you want to provide a different dependency that will be used only during tests (possibly only some specific tests), and will provide a value that can be used where the value of the original dependency ... rovider might be charging you per request, and calling it might take some extra time than if you had a fixed mock user for tests. You probably want to test the external provider once, but not necessarily call it for every test that runs. In this case, ... can override the dependency that calls that provider, and use a custom dependency that returns a mock user, only for your tests. Use the app.dependency_overrides attribute For these cases, your FastAPI application has an attribute app.dependency_over ...
https://man.mtool.work/fastapi/0.115/advanced/testing-dependencies/
Development - Contributing 8538
Development - Contributing Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . First, you might want to see the basic ways to help FastAPI and get help . Developing If ... at you can run that will format and clean all your code: $ bash scripts/format.sh It will also auto-sort all your imports. Tests There is a script that you can run locally to test all the code and generate coverage reports in HTML: $ bash scripts/test ... n the file ./htmlcov/index.html in your browser, you can explore interactively the regions of code that are covered by the tests, and notice if there is any region missing. Docs First, make sure you set up your environment as described above, that wil ... /docs_src/ directory. And those Python files are included/injected in the documentation when generating the site. Docs for tests Most of the tests actually run against the example source files in the documentation. This helps to make sure that: The do ...
https://man.mtool.work/fastapi/0.115/contributing/
Testing Events: startup - shutdown 8034
Testing Events: startup - shutdown Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . When you need your event handlers ( startup and shutdown ) to run in your tests, ...
https://man.mtool.work/fastapi/0.115/advanced/testing-events/
HTTP Basic Auth 7369
HTTP Basic Auth Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . For the simplest cases, you can use HTTP Basic Auth. In HTTP Basic Auth, the application expects a ... the attackers would not try all this by hand, they would write a program to do it, possibly with thousands or millions of tests per second. And they would get just one extra correct letter at a time. But doing that, in some minutes or hours the attac ...
https://man.mtool.work/fastapi/0.115/advanced/security/http-basic-auth/
Virtual Environments 7369
Virtual Environments Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . When you work in Python projects you probably should use a virtual environment (or a similar m ... ng changes in new versions , but it's better to be safe, and install newer versions intentionally and when you can run the tests to check everything is working correctly. Now, imagine that with many other packages that all your projects depend on . Th ...
https://man.mtool.work/fastapi/0.115/virtual-environments/
テスト 7297
テスト Starlette のおかげで、 FastAPI アプリケーションのテストは簡単で楽しいものになっています。 HTTPX がベースなので、非常に使いやすく直感的です。 これを使用すると、 FastAPI と共に pytest を直接利用できます。 TestClient を使用 TestClient を ... クエストの送信とは別に、テストで async 関数 (非同期データベース関数など) を呼び出したい場合は、高度なチュートリアルの Async Tests を参照してください。 テストの分離 実際のアプリケーションでは、おそらくテストを別のファイルに保存します。 また、 FastAPI ア ... 100% ファイルを検知し、自動テストを実行し、結果のレポートを返します。 以下でテストを実行します: $ pytest ================ test session starts ================ platform linux -- Python 3.6.9, pytest-5.3.5, py-1.8.1, pluggy-0.13.1 rootdir: /home/user/c ...
https://man.mtool.work/fastapi/0.115/tutorial/testing/
PREV 1 NEXT