diff --git a/tests/connect/test_show.py b/tests/connect/test_show.py index a463d5de72..3d4234d70b 100644 --- a/tests/connect/test_show.py +++ b/tests/connect/test_show.py @@ -1,9 +1,35 @@ from __future__ import annotations -def test_show(spark_session): +def test_show(spark_session, capsys): df = spark_session.range(10) - try: - df.show() - except Exception as e: - assert False, e + df.show() + captured = capsys.readouterr() + expected = ( + "╭───────╮\n" + "│ id │\n" + "│ --- │\n" + "│ Int64 │\n" + "╞═══════╡\n" + "│ 0 │\n" + "├╌╌╌╌╌╌╌┤\n" + "│ 1 │\n" + "├╌╌╌╌╌╌╌┤\n" + "│ 2 │\n" + "├╌╌╌╌╌╌╌┤\n" + "│ 3 │\n" + "├╌╌╌╌╌╌╌┤\n" + "│ 4 │\n" + "├╌╌╌╌╌╌╌┤\n" + "│ 5 │\n" + "├╌╌╌╌╌╌╌┤\n" + "│ 6 │\n" + "├╌╌╌╌╌╌╌┤\n" + "│ 7 │\n" + "├╌╌╌╌╌╌╌┤\n" + "│ 8 │\n" + "├╌╌╌╌╌╌╌┤\n" + "│ 9 │\n" + "╰───────╯\n" + ) + assert captured.out == expected