@@ -85,10 +85,6 @@ def test_construction():
85
85
with pytest .raises (ValueError ):
86
86
Timedelta ('10 days -1 h 1.5m 1s 3us' )
87
87
88
- # no units specified
89
- with pytest .raises (ValueError ):
90
- Timedelta ('3.1415' )
91
-
92
88
# invalid construction
93
89
tm .assert_raises_regex (ValueError , "cannot construct a Timedelta" ,
94
90
lambda : Timedelta ())
@@ -223,17 +219,14 @@ def __exit__(self, exc_type, exc_val, exc_tb):
223
219
@pytest .mark .parametrize ("redundant_unit, expectation" , [
224
220
("" , not_raises ()),
225
221
("d" , pytest .raises (ValueError )),
226
- ("us" , pytest .raises (ValueError )),
227
- ])
222
+ ("us" , pytest .raises (ValueError ))])
228
223
@pytest .mark .parametrize ("unit" , [
229
- "d" , "m" , "s" , "us"
230
- ])
224
+ "d" , "m" , "s" , "us" ])
231
225
@pytest .mark .parametrize ("sign" , [
232
- + 1 , - 1
233
- ])
226
+ + 1 , - 1 ])
234
227
@pytest .mark .parametrize ("num" , [
235
- 0.001 , 1 , 10
236
- ])
228
+ 0.001 , 1 , 10 ])
237
229
def test_string_with_unit (num , sign , unit , redundant_unit , expectation ):
238
230
with expectation :
239
- assert Timedelta (str (sign * num )+ redundant_unit , unit = unit ) == Timedelta (sign * num , unit = unit )
231
+ assert Timedelta (str (sign * num ) + redundant_unit , unit = unit ) \
232
+ == Timedelta (sign * num , unit = unit )
0 commit comments