@@ -20,21 +20,21 @@ def test_encode_decimal(self):
20
20
Tests encoding a decimal
21
21
"""
22
22
d = Decimal (3.14 )
23
- self . assertEqual ( d , float (d ) )
23
+ assert d == float (d )
24
24
25
25
def test_encode_datetime (self ):
26
26
"""
27
27
Tests encoding a datetime object
28
28
"""
29
29
current_time = datetime .now ()
30
- self .assertEqual ( self . encoder .default (current_time ), current_time .isoformat () )
30
+ assert self .encoder .default (current_time ) == current_time .isoformat ()
31
31
32
32
def test_encode_time (self ):
33
33
"""
34
34
Tests encoding a timezone
35
35
"""
36
36
current_time = datetime .now ().time ()
37
- self .assertEqual ( self . encoder .default (current_time ), current_time .isoformat ()[:12 ])
37
+ assert self .encoder .default (current_time ) == current_time .isoformat ()[:12 ]
38
38
39
39
def test_encode_time_tz (self ):
40
40
"""
@@ -64,18 +64,18 @@ def test_encode_date(self):
64
64
Tests encoding a date object
65
65
"""
66
66
current_date = date .today ()
67
- self .assertEqual ( self . encoder .default (current_date ), current_date .isoformat () )
67
+ assert self .encoder .default (current_date ) == current_date .isoformat ()
68
68
69
69
def test_encode_timedelta (self ):
70
70
"""
71
71
Tests encoding a timedelta object
72
72
"""
73
73
delta = timedelta (hours = 1 )
74
- self .assertEqual ( self . encoder .default (delta ), str (delta .total_seconds () ))
74
+ assert self .encoder .default (delta ) == str (delta .total_seconds ())
75
75
76
76
def test_encode_uuid (self ):
77
77
"""
78
78
Tests encoding a UUID object
79
79
"""
80
80
unique_id = uuid4 ()
81
- self .assertEqual ( self . encoder .default (unique_id ), str (unique_id ) )
81
+ assert self .encoder .default (unique_id ) == str (unique_id )
0 commit comments