diff --git a/poetry.lock b/poetry.lock index f8d6b191..e5c7303c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -577,13 +577,13 @@ virtualenv = ">=20.10.0" [[package]] name = "prompt-toolkit" -version = "3.0.36" +version = "3.0.47" description = "Library for building powerful interactive command lines in Python" optional = false -python-versions = ">=3.6.2" +python-versions = ">=3.7.0" files = [ - {file = "prompt_toolkit-3.0.36-py3-none-any.whl", hash = "sha256:aa64ad242a462c5ff0363a7b9cfe696c20d55d9fc60c11fd8e632d064804d305"}, - {file = "prompt_toolkit-3.0.36.tar.gz", hash = "sha256:3e163f254bef5a03b146397d7c1963bd3e2812f0964bb9a24e6ec761fd28db63"}, + {file = "prompt_toolkit-3.0.47-py3-none-any.whl", hash = "sha256:0d7bfa67001d5e39d02c224b663abc33687405033a8c422d0d675a5a13361d10"}, + {file = "prompt_toolkit-3.0.47.tar.gz", hash = "sha256:1e1b29cb58080b1e69f207c893a1a7bf16d127a5c30c9d17a25a5d77792e5360"}, ] [package.dependencies] @@ -1105,4 +1105,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = ">=3.8" -content-hash = "db61930009e97d1e2fa7b63147a0b523e022bb3dec61a1efca4a01c4d836fa0c" +content-hash = "4a898143b27f1c0aff3d766ee837b824b458164edfd385eed6c53584b303820b" diff --git a/pyproject.toml b/pyproject.toml index 26118abc..db4a095b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ license = "MIT" [tool.poetry.dependencies] python = ">=3.8" -prompt_toolkit = ">=2.0,<=3.0.36" # once https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1726 is fixed, this can be changed to ">=2.0,<4.0" +prompt_toolkit = ">=2.0,<4.0" [tool.poetry.group.docs] optional = true diff --git a/tests/prompts/test_common.py b/tests/prompts/test_common.py index 3250079a..4d62f59d 100644 --- a/tests/prompts/test_common.py +++ b/tests/prompts/test_common.py @@ -1,8 +1,10 @@ +import asyncio from unittest.mock import Mock from unittest.mock import call import pytest from prompt_toolkit.document import Document +from prompt_toolkit.input.defaults import create_pipe_input from prompt_toolkit.output import DummyOutput from prompt_toolkit.styles import Attrs from prompt_toolkit.validation import ValidationError @@ -13,7 +15,6 @@ from questionary.prompts.common import InquirerControl from questionary.prompts.common import build_validator from questionary.prompts.common import print_formatted_text -from tests.utils import execute_with_input_pipe from tests.utils import prompt_toolkit_version @@ -72,7 +73,7 @@ def get_prompt_tokens(): ic = InquirerControl(["a", "b", "c"]) - def run(inp): + async def run(inp): inp.send_text("") layout = common.create_inquirer_layout( ic, get_prompt_tokens, input=inp, output=DummyOutput() @@ -86,7 +87,8 @@ def run(inp): == 1000000000000000000000000000001 ) - execute_with_input_pipe(run) + with create_pipe_input() as inp: + asyncio.run(run(inp)) def test_prompt_highlight_coexist():