@@ -129,9 +129,9 @@ async def test_hpexpire_multiple_fields(r):
129
129
async def test_hexpireat_basic (r ):
130
130
await r .delete ("test:hash" )
131
131
await r .hset ("test:hash" , mapping = {"field1" : "value1" , "field2" : "value2" })
132
- exp_time = int ((datetime .now () + timedelta (seconds = 1 )).timestamp ())
132
+ exp_time = math . ceil ((datetime .now () + timedelta (seconds = 1 )).timestamp ())
133
133
assert await r .hexpireat ("test:hash" , exp_time , "field1" ) == [1 ]
134
- await asyncio .sleep (1 .1 )
134
+ await asyncio .sleep (2 .1 )
135
135
assert await r .hexists ("test:hash" , "field1" ) is False
136
136
assert await r .hexists ("test:hash" , "field2" ) is True
137
137
@@ -140,9 +140,9 @@ async def test_hexpireat_basic(r):
140
140
async def test_hexpireat_with_datetime (r ):
141
141
await r .delete ("test:hash" )
142
142
await r .hset ("test:hash" , mapping = {"field1" : "value1" , "field2" : "value2" })
143
- exp_time = datetime .now () + timedelta (seconds = 1 )
143
+ exp_time = ( datetime .now () + timedelta (seconds = 2 )). replace ( microsecond = 0 )
144
144
assert await r .hexpireat ("test:hash" , exp_time , "field1" ) == [1 ]
145
- await asyncio .sleep (1 .1 )
145
+ await asyncio .sleep (2 .1 )
146
146
assert await r .hexists ("test:hash" , "field1" ) is False
147
147
assert await r .hexists ("test:hash" , "field2" ) is True
148
148
0 commit comments