You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I noticed that tests in the questionary library fail with prompt-toolkit 3.0.41. The log is below. Note that the same happens in python3.12 as well as 3.11. I am trying to package questionary in debian and this is the only current blocker, so would appreciate if a quick fix can be added. I did try to go through the library a bit myself but saw that fixing one thing breaks another and that probably someone who understands the library better can help more.
collected151itemstests/test_examples.py ........ [ 5%]
tests/test_form.py .... [ 7%]
tests/test_prompt.py ....... [ 12%]
tests/test_question.py ....... [ 17%]
tests/test_utils.py .......... [ 23%]
tests/prompts/test_autocomplete.py ....... [ 28%]
tests/prompts/test_checkbox.py ............................ [ 47%]
tests/prompts/test_common.py .....F.... [ 53%]
tests/prompts/test_confirm.py ............ [ 61%]
tests/prompts/test_password.py . [ 62%]
tests/prompts/test_path.py ....... [ 66%]
tests/prompts/test_press_any_key_to_continue.py . [ 67%]
tests/prompts/test_rawselect.py .......... [ 74%]
tests/prompts/test_select.py ................................... [ 97%]
tests/prompts/test_text.py .... [100%]
=========================================================================================================================================================FAILURES==========================================================================================================================================================____________________________________________________________________________________________________________________________________________________test_blank_line_fix____________________________________________________________________________________________________________________________________________________deftest_blank_line_fix():
defget_prompt_tokens():
return [("class:question", "What is your favourite letter?")]
ic=InquirerControl(["a", "b", "c"])
defrun(inp):
inp.send_text("")
layout=common.create_inquirer_layout(
ic, get_prompt_tokens, input=inp, output=DummyOutput()
)
# usually this would be 2000000000000000000000000000000# but `common._fix_unecessary_blank_lines` makes sure# the main window is not as greedy (avoiding blank lines)assert (
layout.container.preferred_height(100, 200).max==1000000000000000000000000000001
)
>execute_with_input_pipe(run)
tests/prompts/test_common.py:89:
_______________________________________________________________________________________________________________________________________________________________tests/utils.py:90: inexecute_with_input_pipereturnfunc(inp)
tests/prompts/test_common.py:84: inrunassert (
/usr/lib/python3/dist-packages/prompt_toolkit/layout/containers.py:319: inpreferred_heightc.preferred_height(width, max_available_height) forcinself._all_children/usr/lib/python3/dist-packages/prompt_toolkit/layout/containers.py:319: inpreferred_heightc.preferred_height(width, max_available_height) forcinself._all_children/usr/lib/python3/dist-packages/prompt_toolkit/layout/containers.py:786: inpreferred_heightreturnself.content.preferred_height(width, max_available_height)
/usr/lib/python3/dist-packages/prompt_toolkit/layout/containers.py:319: inpreferred_heightc.preferred_height(width, max_available_height) forcinself._all_children/usr/lib/python3/dist-packages/prompt_toolkit/layout/containers.py:2629: inpreferred_heightreturnself.content.preferred_height(width, max_available_height)
/usr/lib/python3/dist-packages/prompt_toolkit/layout/containers.py:1611: inpreferred_heightreturnself._merge_dimensions(
/usr/lib/python3/dist-packages/prompt_toolkit/layout/containers.py:1639: in_merge_dimensionspreferred=get_preferred()
/usr/lib/python3/dist-packages/prompt_toolkit/layout/containers.py:1604: inpreferred_content_heightreturnself.content.preferred_height(
/usr/lib/python3/dist-packages/prompt_toolkit/layout/controls.py:620: inpreferred_heightcontent=self.create_content(width, height=1) # Pass a dummy '1' as height./usr/lib/python3/dist-packages/prompt_toolkit/layout/controls.py:721: increate_contentbuffer.load_history_if_not_yet_loaded()
/usr/lib/python3/dist-packages/prompt_toolkit/buffer.py:401: inload_history_if_not_yet_loadedself._load_history_task=get_app().create_background_task(load_history())
_______________________________________________________________________________________________________________________________________________________________self=<prompt_toolkit.application.dummy.DummyApplicationobjectat0x7f62cd8ba3f0>, coroutine=<coroutineobjectBuffer.load_history_if_not_yet_loaded.<locals>.load_historyat0x7f62cdfcca00>defcreate_background_task(
self, coroutine: Coroutine[Any, Any, None]
) ->asyncio.Task[None]:
""" Start a background task (coroutine) for the running application. When the `Application` terminates, unfinished background tasks will be cancelled. Given that we still support Python versions before 3.11, we can't use task groups (and exception groups), because of that, these background tasks are not allowed to raise exceptions. If they do, we'll call the default exception handler from the event loop. If at some point, we have Python 3.11 as the minimum supported Python version, then we can use a `TaskGroup` (with the lifetime of `Application.run_async()`, and run run the background tasks in there. This is not threadsafe. """>loop=self.looporget_running_loop()
ERuntimeError: norunningeventloop/usr/lib/python3/dist-packages/prompt_toolkit/application/application.py:1147: RuntimeError=====================================================================================================================================================warningssummary======================================================================================================================================================tests/prompts/test_confirm.py::test_confirm_enter_default_yes/usr/lib/python3/dist-packages/prompt_toolkit/key_binding/key_bindings.py:277: RuntimeWarning: coroutine'Buffer.load_history_if_not_yet_loaded.<locals>.load_history'wasneverawaitedkeys=tuple(_parse_key(k) forkinkeys)
Enabletracemalloctogettracebackwheretheobjectwasallocated.
Seehttps://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.--Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
The text was updated successfully, but these errors were encountered:
WeepingClown13
changed the title
coroutine was never awaited
"coroutine was never awaited" and "no running event loop"
Dec 12, 2023
Hi, I noticed that tests in the questionary library fail with prompt-toolkit 3.0.41. The log is below. Note that the same happens in python3.12 as well as 3.11. I am trying to package questionary in debian and this is the only current blocker, so would appreciate if a quick fix can be added. I did try to go through the library a bit myself but saw that fixing one thing breaks another and that probably someone who understands the library better can help more.
The text was updated successfully, but these errors were encountered: