Skip to main content

Test ipywidgets with playwright and pytest.

Installation

pip install "pytest-ipywidgets[all]"

(Note that the optional [all] installs all dependencies, including compatible versions of notebook, jupyterlab and voila.)

Usage

Using solara-server (in-process)

If you want to test your ipywidgets with playwright in-process, you can use the solara_test fixture, use display to show your widget in the browser.

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
    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()

Testing in the main Jupyter Environments (Notebook, Lab, Voila & Solara)

See https://solara.dev/documentation/advanced/howto/testing for more information.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_ipywidgets-1.60.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_ipywidgets-1.60.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pytest_ipywidgets-1.60.0.tar.gz.

File metadata

  • Download URL: pytest_ipywidgets-1.60.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pytest_ipywidgets-1.60.0.tar.gz
Algorithm Hash digest
SHA256 0a080a87449a8bb83e60407d8f7ad273e8467427e7e24f41f7a1c5b0321635d8
MD5 ab06105eb94cd702e8f09f91fe0f3979
BLAKE2b-256 4f4fa90757941f43f943529d0ca2ade6510edd45306d54f5a470baf653743ffe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_ipywidgets-1.60.0.tar.gz:

Publisher: test.yaml on widgetti/solara

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_ipywidgets-1.60.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_ipywidgets-1.60.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4b191191d1a42a620d6a3c4c1ed9842aa97da903ebc954dd6f7333c5a99355a
MD5 9459be41c1e4b32dcb5794c410ddd24c
BLAKE2b-256 d9c1b4f169dc6ffd6e4b2f0fcd4c4a13e9c403141e707b0a992f4987ee371b15

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_ipywidgets-1.60.0-py3-none-any.whl:

Publisher: test.yaml on widgetti/solara

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page