Skip to content

Commit c8661ce

Browse files
committed
Skip test if recent shiny is not available
1 parent 9df679e commit c8661ce

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tests/sample_python_apps/itables_in_a_shiny_app_with_tabs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
app_ui = ui.page_fluid(
88
# Display the different tables in different tabs
99
ui.navset_tab(
10-
*[ui.nav(name, ui.HTML(DT(df))) for name, df in get_dict_of_test_dfs().items()]
10+
*[
11+
ui.nav_panel(name, ui.HTML(DT(df)))
12+
for name, df in get_dict_of_test_dfs().items()
13+
]
1114
)
1215
)
1316

tests/test_sample_python_apps.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import runpy
2-
import sys
32
from pathlib import Path
43

54
import pytest
5+
from packaging.version import Version
6+
7+
try:
8+
from shiny import __version__ as shiny_version
9+
except ImportError:
10+
shiny_version = "NA"
611

712

813
def get_app_file_list():
@@ -21,10 +26,9 @@ def test_get_app_file_list():
2126

2227
@pytest.mark.parametrize("app_file", get_app_file_list(), ids=lambda path: path.stem)
2328
@pytest.mark.skipif(
24-
sys.version_info < (3, 7), reason="Shiny does not seem to support Python 3.6"
29+
shiny_version == "NA" or Version(shiny_version) < Version("1.0"),
30+
reason=f"This test requires shiny>=1.0, got {shiny_version}",
2531
)
2632
def test_app_file(app_file):
27-
from shiny import __version__ as shiny_version
28-
2933
print(f"This is shiny=={shiny_version}")
3034
runpy.run_path(str(app_file))

0 commit comments

Comments
 (0)