Skip to content

Commit bbfd009

Browse files
committed
MNT: Add doctest and coverage pragma
1 parent 3ed2e6d commit bbfd009

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

nibabel/casting.py

+5
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,11 @@ def int_to_float(val, flt_type):
467467
-------
468468
f : numpy scalar
469469
of type `flt_type`
470+
471+
Examples
472+
--------
473+
>>> int_to_float(1, np.float32)
474+
1.0
470475
"""
471476
return flt_type(val)
472477

nibabel/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def max_digits():
2424
orig_max_str_digits = sys.get_int_max_str_digits()
2525
yield sys.set_int_max_str_digits
2626
sys.set_int_max_str_digits(orig_max_str_digits)
27-
except AttributeError:
27+
except AttributeError: # pragma: no cover
2828
# Nothing to do for versions of Python that lack these methods
2929
# They were added as DoS protection in Python 3.11 and backported to
3030
# some other versions.

0 commit comments

Comments
 (0)