summaryrefslogtreecommitdiffstats
path: root/docs/pages
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docs/pages/advanced_topics/unit_testing.rst15
-rw-r--r--docs/pages/full_screen_apps.rst4
-rw-r--r--docs/pages/progress_bars.rst2
3 files changed, 18 insertions, 3 deletions
diff --git a/docs/pages/advanced_topics/unit_testing.rst b/docs/pages/advanced_topics/unit_testing.rst
index 2224bfc..02ca82d 100644
--- a/docs/pages/advanced_topics/unit_testing.rst
+++ b/docs/pages/advanced_topics/unit_testing.rst
@@ -116,6 +116,21 @@ single fixture that does it for every test. Something like this:
with create_app_session(input=pipe_input, output=DummyOutput()):
yield pipe_input
+For compatibility with pytest's ``capsys`` fixture, we have to create a new
+:class:`~prompt_toolkit.application.current.AppSession` for every test. This
+can be done in an autouse fixture. Pytest replaces ``sys.stdout`` with a new
+object in every test that uses ``capsys`` and the following will ensure that
+the new :class:`~prompt_toolkit.application.current.AppSession` will each time
+refer to the latest output.
+
+.. code:: python
+
+ from prompt_toolkit.application import create_app_session
+
+ @fixture(autouse=True, scope="function")
+ def _pt_app_session()
+ with create_app_session():
+ yield
Type checking
-------------
diff --git a/docs/pages/full_screen_apps.rst b/docs/pages/full_screen_apps.rst
index 805c8c7..9123c20 100644
--- a/docs/pages/full_screen_apps.rst
+++ b/docs/pages/full_screen_apps.rst
@@ -358,7 +358,7 @@ As said earlier, a :class:`~prompt_toolkit.layout.Window` is a
.. note::
- Basically, windows are the leafs in the tree structure that represent the UI.
+ Basically, windows are the leaves in the tree structure that represent the UI.
A :class:`~prompt_toolkit.layout.Window` provides a "view" on the
:class:`~prompt_toolkit.layout.UIControl`, which provides lines of content. The
@@ -391,7 +391,7 @@ A :class:`~prompt_toolkit.layout.processors.Processor` operates on individual
lines. Basically, it takes a (formatted) line and produces a new (formatted)
line.
-Some build-in processors:
+Some built-in processors:
+----------------------------------------------------------------------------+-----------------------------------------------------------+
| Processor | Usage: |
diff --git a/docs/pages/progress_bars.rst b/docs/pages/progress_bars.rst
index 54a8ee1..5248f98 100644
--- a/docs/pages/progress_bars.rst
+++ b/docs/pages/progress_bars.rst
@@ -237,7 +237,7 @@ printing text possible while the progress bar is displayed. This ensures that
printing happens above the progress bar.
Further, when "x" is pressed, we set a cancel flag, which stops the progress.
-It would also be possible to send `SIGINT` to the mean thread, but that's not
+It would also be possible to send `SIGINT` to the main thread, but that's not
always considered a clean way of cancelling something.
In the example above, we also display a toolbar at the bottom which shows the