1
1
import unittest
2
- from datetime import datetime
2
+ from datetime import datetime , timezone
3
3
4
4
from reactivex import operators as ops
5
5
from reactivex .testing import ReactiveTest , TestScheduler
@@ -30,7 +30,7 @@ def test_takeuntil_zero(self):
30
30
)
31
31
32
32
def create ():
33
- return xs .pipe (ops .take_until_with_time (datetime .utcfromtimestamp (0 )))
33
+ return xs .pipe (ops .take_until_with_time (datetime .fromtimestamp (0 )), tz = timezone . utc )
34
34
35
35
res = scheduler .start (create )
36
36
@@ -44,7 +44,7 @@ def test_takeuntil_late(self):
44
44
)
45
45
46
46
def create ():
47
- dt = datetime .utcfromtimestamp (250 )
47
+ dt = datetime .fromtimestamp (250 , tz = timezone . utc )
48
48
return xs .pipe (ops .take_until_with_time (dt ))
49
49
50
50
res = scheduler .start (create )
@@ -58,7 +58,7 @@ def test_takeuntil_error(self):
58
58
xs = scheduler .create_hot_observable (on_error (210 , ex ))
59
59
60
60
def create ():
61
- dt = datetime .utcfromtimestamp (250 )
61
+ dt = datetime .fromtimestamp (250 , tz = timezone . utc )
62
62
return xs .pipe (ops .take_until_with_time (dt ))
63
63
64
64
res = scheduler .start (create )
@@ -71,7 +71,7 @@ def test_takeuntil_never(self):
71
71
xs = scheduler .create_hot_observable ()
72
72
73
73
def create ():
74
- dt = datetime .utcfromtimestamp (250 )
74
+ dt = datetime .fromtimestamp (250 , tz = timezone . utc )
75
75
return xs .pipe (ops .take_until_with_time (dt ))
76
76
77
77
res = scheduler .start (create )
@@ -92,8 +92,8 @@ def test_takeuntil_twice1(self):
92
92
)
93
93
94
94
def create ():
95
- dt235 = datetime .utcfromtimestamp (235 )
96
- dt255 = datetime .utcfromtimestamp (255 )
95
+ dt235 = datetime .fromtimestamp (235 , tz = timezone . utc )
96
+ dt255 = datetime .fromtimestamp (255 , tz = timezone . utc )
97
97
return xs .pipe (
98
98
ops .take_until_with_time (dt255 ),
99
99
ops .take_until_with_time (dt235 ),
@@ -122,8 +122,8 @@ def test_takeuntil_twice2(self):
122
122
)
123
123
124
124
def create ():
125
- dt235 = datetime .utcfromtimestamp (235 )
126
- dt255 = datetime .utcfromtimestamp (255 )
125
+ dt235 = datetime .fromtimestamp (235 , tz = timezone . utc )
126
+ dt255 = datetime .fromtimestamp (255 , tz = timezone . utc )
127
127
return xs .pipe (
128
128
ops .take_until_with_time (dt235 ),
129
129
ops .take_until_with_time (dt255 ),
0 commit comments