Skip to content

Commit 93c8f93

Browse files
author
Sylvain MARIE
committed
Fixed last failing test
1 parent 98d4cb4 commit 93c8f93

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pandas/tests/io/formats/test_format.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3354,18 +3354,15 @@ def test_fast_strftime_perf(self, strftime_format):
33543354
assert old_style_best < new_style_best # even better !
33553355

33563356
def test_bad_strftime_directive(self):
3357-
"""Test which kind of error is output in case of bad `date_format` directive."""
3357+
"""Test what happens in case of bad `date_format` directive."""
33583358

3359-
# TODO make sure that it does not become very hard for users to understand
33603359
x = Series(date_range("20130101 09:00:00", periods=5, freq="us"))
33613360

33623361
# This does not raise any error, while %D is not a correct directive !
33633362
x.dt.strftime(date_format="%Y-%M-%D___", fast_strftime=False)
33643363

3365-
# This raises a `TypeError: not enough arguments for format string`
3366-
with pytest.raises(TypeError):
3367-
x.dt.strftime(date_format="%Y-%M-%D___")
3368-
# TODO raise a more readable error ?
3364+
# We align with the same behaviour
3365+
x.dt.strftime(date_format="%Y-%M-%D___")
33693366

33703367
@pytest.mark.parametrize("date_format", (
33713368
# note: "%Y-%m-%d %H:%M:%S and "%Y-%m-%d %H:%M:%S.%f are always accelerated (hardcoded)

0 commit comments

Comments
 (0)