Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy committed Oct 31, 2024
1 parent ea25721 commit 9e3e6d9
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tests/test_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,24 @@ def test_basic_write(tmp_path): # type: ignore[no-untyped-def]

@pytest.mark.skipif(not HAVE_FITSIO, reason="test requires fitsio")
def test_write_exception(tmp_path): # type: ignore[no-untyped-def]
# Custom exception for controlled testing
class TestWriteError(Exception):
pass
"""Custom exception for controlled testing."""

def raise_error(msg: str) -> TestWriteError:

def raise_error(msg: str) -> None:
"""Raise a custom exception for controlled testing.
Parameters
----------
msg
A message to be passed to the exception.
Raises
------
TestWriteError
A custom exception for controlled testing.
"""
raise TestWriteError(msg)

try:
Expand Down

0 comments on commit 9e3e6d9

Please sign in to comment.