Skip to content

Some clean up for PR #45 #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test_setup_globals():
# fmt: off
global BUTTON_CLASS_NAME, OUTPUT_CLASS_NAME, TEXT_INPUT_CLASS_NAME, \
CODE_MIRROR_CLASS_NAME, MATPLOTLIB_CANVAS_CLASS_NAME, CUE_BOX_CLASS_NAME, \
PRIVACY_BUTTON
PRIVACY_BUTTON_CLASS_NAME
global CUED_CUE_BOX_CLASS_NAME, RESET_CUE_BUTTON_CLASS_NAME, \
CUED_RESET_CUE_BUTTON_CLASS_NAME
# fmt: on
Expand All @@ -176,7 +176,7 @@ def test_setup_globals():
"lm-Widget.lm-Panel.jupyter-widgets.widget-container"
".widget-box.widget-vbox.scwidget-cue-box"
)
PRIVACY_BUTTON = "bp3-button.bp3-small.jp-toast-button.jp-Button"
PRIVACY_BUTTON_CLASS_NAME = "bp3-button.bp3-small.jp-toast-button.jp-Button"
elif JUPYTER_TYPE == "lab" and JUPYTER_VERSION < Version("4.0.0"):
BUTTON_CLASS_NAME = (
"lm-Widget.p-Widget.jupyter-widgets.jupyter-button.widget-button"
Expand All @@ -194,7 +194,7 @@ def test_setup_globals():
"lm-Widget.p-Widget.lm-Panel.p-Panel.jupyter-widgets."
"widget-container.widget-box.widget-vbox.scwidget-cue-box"
)
PRIVACY_BUTTON = "bp3-button.bp3-small.jp-toast-button.jp-Button"
PRIVACY_BUTTON_CLASS_NAME = "bp3-button.bp3-small.jp-toast-button.jp-Button"
elif JUPYTER_TYPE == "lab" and JUPYTER_VERSION >= Version("4.0.0"):
BUTTON_CLASS_NAME = "lm-Widget.jupyter-widgets.jupyter-button.widget-button"
OUTPUT_CLASS_NAME = (
Expand All @@ -211,7 +211,7 @@ def test_setup_globals():
"lm-Widget.lm-Panel.jupyter-widgets.widget-container."
"widget-box.widget-vbox.scwidget-cue-box"
)
PRIVACY_BUTTON = "jp-toast-button.jp-mod-small.jp-Button"
PRIVACY_BUTTON_CLASS_NAME = "jp-toast-button.jp-mod-small.jp-Button"
else:
raise ValueError(
f"Tests do not support jupyter type {JUPYTER_TYPE!r} for version"
Expand All @@ -237,7 +237,7 @@ def test_privacy_policy(selenium_driver):
driver = selenium_driver("tests/notebooks/widget_answers.ipynb")
# we search for the button to appear so we can be sure that the privacy window
# appeared
privacy_buttons = driver.find_elements(By.CLASS_NAME, PRIVACY_BUTTON)
privacy_buttons = driver.find_elements(By.CLASS_NAME, PRIVACY_BUTTON_CLASS_NAME)
yes_button = None
for button in privacy_buttons:
if button.text == "Yes":
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ deps =
commands =
# converts the python files to ipython notebooks
jupytext tests/notebooks/*.py --to ipynb
pytest {posargs:-v} --reruns 2 --driver Firefox
pytest {posargs:-v --reruns 2} --driver Firefox

[testenv:tests-lab-4]
description =
Expand Down Expand Up @@ -75,7 +75,7 @@ deps =
commands =
# converts the python files to ipython notebooks
jupytext tests/notebooks/*.py --to ipynb
pytest {posargs:-v} -m "not matplotlib" --reruns 2 --driver Firefox
pytest {posargs:-v --reruns 2} -m "not matplotlib" --driver Firefox

[testenv:coverage]
# We do coverage in a separate environment that skips the selenium tests but
Expand Down
Loading