Skip to content

Commit 85f04c9

Browse files
victorjorisvandenbossche
victor
authored andcommitted
Updated test.
1 parent e322630 commit 85f04c9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pandas/tests/scalar/timedelta/test_construction.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ def test_construction():
8989
with pytest.raises(ValueError):
9090
Timedelta('3.1415')
9191

92+
with pytest.raises(ValueError):
93+
Timedelta('2000')
94+
9295
# invalid construction
9396
tm.assert_raises_regex(ValueError, "cannot construct a Timedelta",
9497
lambda: Timedelta())
@@ -213,10 +216,11 @@ def test_td_constructor_value_error():
213216

214217

215218
@pytest.mark.parametrize("str_unit, unit, expectation", [
216-
("", "s", tm.do_not_raise),
217-
("s", "s", pytest.raises(ValueError)),
218-
("", None, pytest.raises(ValueError)),
219-
("s", "d", pytest.raises(ValueError)),])
219+
("", "s", tm.do_not_raise), # Expected case
220+
("s", "s", pytest.raises(ValueError)), # Units doubly defined
221+
("s", "d", pytest.raises(ValueError)),
222+
("", None, pytest.raises(ValueError)), # No units
223+
])
220224
def test_string_with_unit(str_unit, unit, expectation):
221225
with expectation:
222226
val_str = "10{}".format(str_unit)

0 commit comments

Comments
 (0)