Skip to content

Commit

Permalink
Add full errors to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aarmaane committed Dec 12, 2024
1 parent cd4584d commit 813772b
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@ def test_map_exe_error_msg(tmpdir):
"""Map exe returns non-zero with stderr output should produce an
error message and forward the stderr output.
"""
with tmpdir.as_cwd(), pytest.raises(madoop.MadoopError,
match="Map error message"):
with tmpdir.as_cwd(), pytest.raises(
madoop.MadoopError,
match="Map error message to stderr"
):
madoop.mapreduce(
input_path=TESTDATA_DIR/"word_count/input",
output_dir="output",
Expand All @@ -225,8 +227,10 @@ def test_map_exe_error_msg(tmpdir):
partitioner=None,
)

with tmpdir.as_cwd(), pytest.raises(madoop.MadoopError,
match="Map error message"):
with tmpdir.as_cwd(), pytest.raises(
madoop.MadoopError,
match="Map error message to stderr"
):
map_stage(
exe=TESTDATA_DIR/"word_count/map_error_msg.py",
input_dir=TESTDATA_DIR/"word_count/input",
Expand All @@ -238,8 +242,10 @@ def test_partition_exe_error_msg(tmpdir):
"""Partition exe returns non-zero with stderr output should produce an
error message and forward the stderr output.
"""
with tmpdir.as_cwd(), pytest.raises(madoop.MadoopError,
match="Partition error message"):
with tmpdir.as_cwd(), pytest.raises(
madoop.MadoopError,
match="Partition error message to stderr"
):
madoop.mapreduce(
input_path=TESTDATA_DIR/"word_count/input",
output_dir="output",
Expand All @@ -254,8 +260,10 @@ def test_reduce_exe_error_msg(tmpdir):
"""Reduce exe returns non-zero with stderr output should produce an
error message and forward the stderr output.
"""
with tmpdir.as_cwd(), pytest.raises(madoop.MadoopError,
match="Reduce error message"):
with tmpdir.as_cwd(), pytest.raises(
madoop.MadoopError,
match="Reduce error message to stderr"
):
reduce_stage(
exe=TESTDATA_DIR/"word_count/reduce_error_msg.py",
input_dir=TESTDATA_DIR/"word_count/input",
Expand Down

0 comments on commit 813772b

Please sign in to comment.