Skip to content

Commit

Permalink
TST: Move codice xfail into a separate test (#377)
Browse files Browse the repository at this point in the history
Explicitly test that the function raises what we think rather than xfailing.
greglucas authored Mar 28, 2024
1 parent 350712c commit 5241def
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion imap_processing/tests/codice/test_decompress.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
(LZMA_EXAMPLE, CoDICECompression.LOSSLESS, 234),
(LZMA_EXAMPLE, CoDICECompression.LOSSY_A_LOSSLESS, 221184),
(LZMA_EXAMPLE, CoDICECompression.LOSSY_B_LOSSLESS, 1441792),
pytest.param(None, "some_unsupported_algorithm", None, marks=pytest.mark.xfail()),
]


@@ -39,3 +38,10 @@ def test_decompress(compressed_value: int, algorithm: IntEnum, expected_result:

decompressed_value = decompress(compressed_value, algorithm)
assert decompressed_value == expected_result


def test_decompress_raises():
"""Tests that the ``decompress`` function raises with an unknown algorithm"""

with pytest.raises(ValueError, match="some_unsupported_algorithm"):
decompress(234, "some_unsupported_algorithm")

0 comments on commit 5241def

Please sign in to comment.