🌐 Add Korean translation for docs/ko/docs/advanced/async-test.md#12918
Conversation
docs/ko/docs/advanced/async-test.md
|
📝 Docs preview for commit 4e9ba61 at: https://2b1a869e.fastapitiangolo.pages.dev Modified Pages |
docs/ko/docs/advanced/async-test.mddocs/ko/docs/advanced/async-test.md
| 예를 들면 데이터베이스에 비동기로 쿼리하는 경우, | ||
| FastAPI 어플리케이션에 요청을 보내고 비동기 데이터 베이스 라이브러리를 사용해 백엔드 서버가 데이터베이스에 데이터를 성공적으로 작성했는지 확인하는 경우를 생각해봅시다. |
There was a problem hiding this comment.
Being able to use asynchronous functions in your tests could be useful
The above sentence needs to be included.
| `TestClient`는 표준 pytest를 사용하여 비동기 FastAPI 애플리케이션을 일반적인 `def` 테스트 함수 내에서 호출할 수 있도록 내부적으로 마법 같은 처리를 합니다. | ||
|
|
||
| 그러나 테스트를 비동기로 실행하면 더 이상 테스트 함수 내에서 `TestClient`를 사용할 수 없게 됩니다 |
There was a problem hiding this comment.
But that magic doesn't work anymore when we're using it inside asynchronous functions. By running our tests asynchronously, we can no longer use the TestClient inside our test functions.
You should respect the original. It's oversimplified.
| `TestClient`는 표준 pytest를 사용하여 비동기 FastAPI 애플리케이션을 일반적인 `def` 테스트 함수 내에서 호출할 수 있도록 내부적으로 마법 같은 처리를 합니다. | |
| 그러나 테스트를 비동기로 실행하면 더 이상 테스트 함수 내에서 `TestClient`를 사용할 수 없게 됩니다 | |
| `TestClient`는 표준 pytest를 사용하여 비동기 FastAPI 애플리케이션을 일반적인 `def` 테스트 함수 내에서 호출할 수 있도록 내부적으로 마법 같은 처리를 합니다. 하지만 이 마법은 비동기 함수 내부에서 사용할 때는 더 이상 작동하지 않습니다. 테스트를 비동기적으로 실행하면, 더 이상 테스트 함수 내부에서 `TestClient`를 사용할 수 없습니다. |
|
|
||
| ## 예시 | ||
|
|
||
| 간단한 예시를 위해 앞선 챕터 [Bigger Applications](../tutorial/bigger-applications.md){.internal-link target=_blank} 와 [Testing](../tutorial/testing.md){.internal-link target=_blank}:에서 다룬 파일 구조와 비슷한 형태를 확인해봅시다. |
There was a problem hiding this comment.
| 간단한 예시를 위해 앞선 챕터 [Bigger Applications](../tutorial/bigger-applications.md){.internal-link target=_blank} 와 [Testing](../tutorial/testing.md){.internal-link target=_blank}:에서 다룬 파일 구조와 비슷한 형태를 확인해봅시다. | |
| 간단한 예시를 위해 [Bigger Applications](../tutorial/bigger-applications.md){.internal-link target=_blank} 와 [Testing](../tutorial/testing.md){.internal-link target=_blank}에서 다룬 파일 구조와 비슷한 형태를 확인해봅시다: |
Please translate the linked titles. Although they still have not been translated.
|
|
||
| {* ../../docs_src/async_tests/test_main.py hl[7] *} | ||
|
|
||
| /// tip |
There was a problem hiding this comment.
| /// tip | |
| /// tip | 팁 |
| │ └── test_main.py | ||
| ``` | ||
|
|
||
| `main.py` 파일에는 아래의 내용이 있습니다. |
There was a problem hiding this comment.
| `main.py` 파일에는 아래의 내용이 있습니다. | |
| `main.py`는 아래와 같아야 합니다: |
It's more natural, and don't miss the colon.
|
|
||
| {* ../../docs_src/async_tests/main.py *} | ||
|
|
||
| `main.py` 의 테스트코드인 `test_main.py` 에는 아래의 내용이 있습니다. |
There was a problem hiding this comment.
| `main.py` 의 테스트코드인 `test_main.py` 에는 아래의 내용이 있습니다. | |
| `test_main.py` 파일은 `main.py`에 대한 테스트가 있을 텐데, 다음과 같을 수 있습니다: |
If you keep the nuance "would" and "could", it would be better.
|
|
||
| {* ../../docs_src/async_tests/test_main.py *} | ||
|
|
||
| ## Run it |
|
|
||
| /// | ||
|
|
||
| /// warning |
There was a problem hiding this comment.
| /// warning | |
| /// warning | 경고 |
|
|
||
| 테스트 함수가 이제 비동기 함수이므로, FastAPI 애플리케이션에 요청을 보내는 것 외에도 다른 `async` 함수를 호출하고 `await` 키워드를 사용 할 수 있습니다. | ||
|
|
||
| /// tip |
There was a problem hiding this comment.
| /// tip | |
| /// tip | 팁 |
|
📝 Docs preview for commit 749dc03 at: https://e92a9513.fastapitiangolo.pages.dev Modified Pages |
|
@hard-coders I appreciate your feedback! I've made the suggested changes as advised. Thanks again! (- - )(_ _) (- - ) 꾸벅 |
|
📝 Docs preview for commit b798c15 at: https://7f1af5ee.fastapitiangolo.pages.dev Modified Pages |
hard-coders
left a comment
There was a problem hiding this comment.
Great job 👍🏻, but here are some missing points.
|
|
||
| **FastAPI** 애플리케이션이 `async def` 대신 `def` 키워드로 선언된 함수를 사용하더라도, 내부적으로는 여전히 `비동기` 애플리케이션입니다. | ||
|
|
||
| `TestClient`는 표준 pytest를 사용하여 비동기 FastAPI 애플리케이션을 일반적인 `def` 테스트 함수 내에서 호출할 수 있도록 내부적으로 마법 같은 처리를 합니다. 하지만 이 마법은 비동기 함수 내부에서 사용할 때는 더 이상 작동하지 않습니다. 테스트를 비동기적으로 실행하면, 더 이상 테스트 함수 내부에서 `TestClient`를 사용할 수 없습니다. |
There was a problem hiding this comment.
| `TestClient`는 표준 pytest를 사용하여 비동기 FastAPI 애플리케이션을 일반적인 `def` 테스트 함수 내에서 호출할 수 있도록 내부적으로 마법 같은 처리를 합니다. 하지만 이 마법은 비동기 함수 내부에서 사용할 때는 더 이상 작동하지 않습니다. 테스트를 비동기적으로 실행하면, 더 이상 테스트 함수 내부에서 `TestClient`를 사용할 수 없습니다. | |
| `TestClient`는 pytest 표준을 사용하여 비동기 FastAPI 애플리케이션을 일반적인 `def` 테스트 함수 내에서 호출할 수 있도록 내부에서 마술을 부립니다. 하지만 이 마술은 비동기 함수 내부에서 사용할 때는 더 이상 작동하지 않습니다. 테스트를 비동기로 실행하면, 더 이상 테스트 함수 내부에서 `TestClient`를 사용할 수 없습니다. |
It's a suggestion, and I welcome feedback. 😃
먼저, "표준 pytest"는 마치 pytest가 표준인거 같은 느낌을 받습니다. de facto 일지는 모르나 표준은 아니며, 여기서는 pytest의 표준을 의미하므로 "pytest 표준"으로 바꿔서 혼선을 덜었으면 합니다.
그리고, "~적, ~적인"이란 표현이 반복됩니다.
- "내부적으로" -> "내부에서"
- "비동기적" -> "비동기"
과 같이 명확한 표현은 그대로 살렸으면 합니다.
There was a problem hiding this comment.
I second this
Especially 표준 pytest -> pytest 내 표준
|
|
||
| `TestClient`는 표준 pytest를 사용하여 비동기 FastAPI 애플리케이션을 일반적인 `def` 테스트 함수 내에서 호출할 수 있도록 내부적으로 마법 같은 처리를 합니다. 하지만 이 마법은 비동기 함수 내부에서 사용할 때는 더 이상 작동하지 않습니다. 테스트를 비동기적으로 실행하면, 더 이상 테스트 함수 내부에서 `TestClient`를 사용할 수 없습니다. | ||
|
|
||
| TestClient는 <a href="https://www.python-httpx.org" class="external-link" target="_blank">HTTPX</a>를 기반으로 하고 있으며, 다행히 이를 직접 사용하여 API를 테스트할 수 있습니다. |
There was a problem hiding this comment.
| TestClient는 <a href="https://www.python-httpx.org" class="external-link" target="_blank">HTTPX</a>를 기반으로 하고 있으며, 다행히 이를 직접 사용하여 API를 테스트할 수 있습니다. | |
| `TestClient`는 <a href="https://www.python-httpx.org" class="external-link" target="_blank">HTTPX</a>를 기반으로 하고 있으며, 다행히 이를 직접 사용하여 API를 테스트할 수 있습니다. |
Missing backtick.
|
|
||
| {* ../../docs_src/async_tests/test_main.py *} | ||
|
|
||
| ## 실행 하기! |
There was a problem hiding this comment.
| ## 실행 하기! | |
| ## 실행하기 |
The character ! does not exist, and fix 띄어쓰기
|
|
||
| /// tip | 팁 | ||
|
|
||
| 테스트에 비동기 함수 호출을 통합할 때 (예: <a href="https://stackoverflow.com/questions/41584243/runtimeerror-task-attached-to-a-different-loop" class="external-link" target="_blank">MongoDB의 MotorClient</a>를 사용할 때) RuntimeError: Task attached to a different loop 오류가 발생한다면, 이벤트 루프가 필요한 객체는 반드시 비동기 함수 내에서만 인스턴스화해야 한다는 점을 주의하세요! |
There was a problem hiding this comment.
| 테스트에 비동기 함수 호출을 통합할 때 (예: <a href="https://stackoverflow.com/questions/41584243/runtimeerror-task-attached-to-a-different-loop" class="external-link" target="_blank">MongoDB의 MotorClient</a>를 사용할 때) RuntimeError: Task attached to a different loop 오류가 발생한다면, 이벤트 루프가 필요한 객체는 반드시 비동기 함수 내에서만 인스턴스화해야 한다는 점을 주의하세요! | |
| 테스트에 비동기 함수 호출을 통합할 때 (예: <a href="https://stackoverflow.com/questions/41584243/runtimeerror-task-attached-to-a-different-loop" class="external-link" target="_blank">MongoDB의 MotorClient</a>를 사용할 때) `RuntimeError: Task attached to a different loop` 오류가 발생한다면, 이벤트 루프가 필요한 객체는 반드시 비동기 함수 내에서만 인스턴스화해야 한다는 점을 주의하세요! |
missing backtick
|
📝 Docs preview for commit a59bbd2 at: https://1b8c70e3.fastapitiangolo.pages.dev Modified Pages |
|
Thanks a lot for your contribution @icehongssii and help @hard-coders 🚀 ✨ |
|
@alejsdev |
|
📝 Docs preview for commit ad91c32 at: https://97d59428.fastapitiangolo.pages.dev Modified Pages |
|
📝 Docs preview for commit 949b01c at: https://26a122ac.fastapitiangolo.pages.dev Modified Pages |
|
📝 Docs preview for commit 949b01c at: https://376d5622.fastapitiangolo.pages.dev Modified Pages |
🌐Add korean translation for docs/ko/docs/advanced/async-test.md