We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5a2b3a commit 45dfd7cCopy full SHA for 45dfd7c
pandas/tests/scalar/timedelta/test_construction.py
@@ -89,6 +89,9 @@ def test_construction():
89
with pytest.raises(ValueError):
90
Timedelta('3.1415')
91
92
+ with pytest.raises(ValueError):
93
+ Timedelta('2000')
94
+
95
# invalid construction
96
tm.assert_raises_regex(ValueError, "cannot construct a Timedelta",
97
lambda: Timedelta())
@@ -213,10 +216,11 @@ def test_td_constructor_value_error():
213
216
214
217
215
218
@pytest.mark.parametrize("str_unit, unit, expectation", [
- ("", "s", tm.do_not_raise),
- ("s", "s", pytest.raises(ValueError)),
- ("", None, pytest.raises(ValueError)),
219
- ("s", "d", pytest.raises(ValueError)),])
+ ("", "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
+])
224
def test_string_with_unit(str_unit, unit, expectation):
225
with expectation:
226
val_str = "10{}".format(str_unit)
0 commit comments