Skip to content

Commit 2ce2c06

Browse files
committed
Improve test_spark_r_nbconvert: add local_sparklyr back, test all output formats
1 parent 2766279 commit 2ce2c06

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

Diff for: tests/by_image/all-spark-notebook/test_spark_r_nbconvert.py

+18-7
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,29 @@
1414

1515
@pytest.mark.flaky(retries=3, delay=1)
1616
@pytest.mark.parametrize(
17-
"test_file",
18-
["local_sparkR"],
17+
"test_file,expected_warnings",
18+
[
19+
("local_sparkR", ["WARNING: Using incubator modules: jdk.incubator.vector"]),
20+
("local_sparklyr", []),
21+
],
1922
)
2023
@pytest.mark.parametrize("output_format", ["pdf", "html", "markdown"])
2124
def test_spark_r_nbconvert(
22-
container: TrackedContainer, test_file: str, output_format: str
25+
container: TrackedContainer,
26+
test_file: str,
27+
output_format: str,
28+
expected_warnings: list[str],
2329
) -> None:
2430
host_data_file = THIS_DIR / "data" / f"{test_file}.ipynb"
2531
logs = check_nbconvert(
26-
container, host_data_file, "markdown", execute=True, no_warnings=False
32+
container,
33+
host_data_file,
34+
output_format,
35+
execute=True,
36+
no_warnings=(not expected_warnings),
2737
)
2838

29-
warnings = TrackedContainer.get_warnings(logs)
30-
assert len(warnings) == 1
31-
assert "Using incubator modules: jdk.incubator.vector" in warnings[0]
39+
if expected_warnings:
40+
warnings = TrackedContainer.get_warnings(logs)
41+
assert len(warnings) == len(expected_warnings)
42+
assert expected_warnings[0] == warnings[0]

0 commit comments

Comments
 (0)