Skip to main content

No project description provided

Project description

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.

Project details


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.57.3.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.57.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytest_ipywidgets-1.57.3.tar.gz
Algorithm Hash digest
SHA256 8fc19377613d8529397da611335928ed1b91e43cdd1b4cda299a2ea76911b868
MD5 6f9669bf0b829afaa2708d5a99829f89
BLAKE2b-256 f284e94628e5a40a3abc6f2122c93ad13b7d6cf232c3f8c65e84cba9c7b1308a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_ipywidgets-1.57.3.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.57.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_ipywidgets-1.57.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f34b403dbef30f2d1725b07aa724882dc7ff3bd8ad267b96ab5d1d64dd10d7f9
MD5 f98e8744e77635373c6ea0520b98b3a3
BLAKE2b-256 2711c45b5283aa4d6cb8dfd6430eab47157889ecd3ade374fac7ecf292c1bd8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_ipywidgets-1.57.3-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 Pingdom Monitoring Sentry Error logging StatusPage Status page