Closed astrofrog closed 1 year ago
The currentThread / setDaemon issue is fixed in 6205d21308bc2e41c533bb4a514090059f6c750d If you have more information on how I can reproduce the other issue, please let me know here.
To reproduce the issues I'm seeing, you can take the pytest example straight from the docs:
import ipywidgets as widgets
import playwright.sync_api
from IPython.display import display
def test_widget_button_solara(solara_test, page_session: playwright.sync_api.Page):
# this all runs in process, which only works with solara
# also, this test is only with pure ipywidgets
button = widgets.Button(description="Click Me!")
def change_description(obj):
button.description = "Tested event"
button.on_click(change_description)
display(button)
button_sel = page_session.locator("text=Click Me!")
button_sel.wait_for()
button_sel.click()
page_session.locator("text=Tested event").wait_for()
and put it in a file called e.g. test_example.py
then run:
pytest test_example.py --headed -W error::DeprecationWarning
Currently this errors with:
DeprecationWarning: currentThread() is deprecated, use current_thread() instead
If you ignore this warning specifically you can get a bit further:
pytest test_example.py --headed -W error::DeprecationWarning -W ignore:currentThread
but then the window that pops up flashes in a loop and keeps saying 'Server disconnected' so clearly a deprecation warning is happening which is getting turned into an error when the server starts up
There is still something in Reacton using something deprecated, but https://github.com/widgetti/solara/commit/73024937b2ffc49f3b2225f8b9145c7a4e6221b3 and https://github.com/widgetti/solara/commit/b632d4fbc214793f8d6f7636155d321e962db4fb should fix this
When using solara with Python 3.11 I am running into deprecation warnings regarding the use of
currentThread
andsetDaemon
. I am also running into another deprecation warning that I can't track down - when I run solara from pytest, and set the-W error:DeprecationWarning
flag, the starlette server keeps closing down and re-opening:and the test hangs. This suggests there is a deprecation warning being emitted during the server startup but I couldn't track it down.