Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Keep NumPy durations out of integer formatting
  • Loading branch information
Sskift committed Nov 2, 2026
commit be48e8dd4935b9cd0765f1c9a34c8e82afcdec9b
7 changes: 7 additions & 0 deletions test/test_numpy_integers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ def test_numpy_integer_formats(input_type, intfmt, dtype):

options = {"tablefmt": "plain", "showindex": False, "intfmt": intfmt, "floatfmt": ".0f"}
assert tabulate(table, **options) == tabulate([[int(value)]], **options)


def test_numpy_duration_is_not_formatted_as_integer():
numpy = pytest.importorskip("numpy")
value = numpy.timedelta64(1, "D")

assert tabulate([[value]], tablefmt="plain", intfmt="x") == str(value)