Skip to content

Commit e54db0e

Browse files
authored
docs(testing): clarify testing frameworks section (#4898)
* docs(testing): clarify testing frameworks section * explain the auto asyncio mode
1 parent 4c0efd5 commit e54db0e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/guide/testing.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,16 @@ Your test code will help you find bugs early, and alert you if you accidentally
2323

2424
## Testing frameworks for Textual
2525

26-
Textual doesn't require any particular test framework.
27-
You can use any test framework you are familiar with, but we will be using [pytest](https://docs.pytest.org/) in this chapter.
26+
Textual is an async framework powered by Python's [asyncio](https://docs.python.org/3/library/asyncio.html) library.
27+
While Textual doesn't require a particular test framework, it must provide support for asyncio testing.
2828

29+
You can use any test framework you are familiar with, but we will be using [pytest](https://docs.pytest.org/)
30+
along with the [pytest-asyncio](https://pytest-asyncio.readthedocs.io/) plugin in this chapter.
31+
32+
By default, the `pytest-asyncio` plugin requires each async test to be decorated with `@pytest.mark.asyncio`.
33+
You can avoid having to add this marker to every async test
34+
by setting `asyncio_mode = auto` in your pytest configuration
35+
or by running pytest with the `--asyncio-mode=auto` option.
2936

3037
## Testing apps
3138

0 commit comments

Comments
 (0)