@@ -102,21 +102,21 @@ def test_get_stats_invalid_url(self, dltest, invalid_url):
102
102
options = dynamic_links .StatOptions (duration_days = 9 )
103
103
with pytest .raises (ValueError ) as excinfo :
104
104
dynamic_links .get_link_stats (invalid_url , options , app = dltest .app )
105
- assert 'Url must be a string and begin with "https://".' in excinfo .value . message
105
+ assert 'Url must be a string and begin w
8000
ith "https://".' in str ( excinfo .value )
106
106
107
107
@pytest .mark .parametrize ('invalid_options' , INVALID_STRINGS )
108
108
def test_get_stats_invalid_options (self , dltest , invalid_options ):
109
109
with pytest .raises (ValueError ) as excinfo :
110
110
dynamic_links .get_link_stats (_MOCK_SHORT_URL , invalid_options , app = dltest .app )
111
- assert 'Options must be of type StatOptions.' in excinfo .value . message
111
+ assert 'Options must be of type StatOptions.' in str ( excinfo .value )
112
112
113
113
@pytest .mark .parametrize ('invalid_duration' , [0 ] + INVALID_NON_NEGATIVE_NUMS )
114
114
def test_get_stats_invalid_duration_days (self , dltest , invalid_duration ):
115
115
options = dynamic_links .StatOptions (duration_days = invalid_duration )
116
116
with pytest .raises (ValueError ) as excinfo :
117
117
dynamic_links .get_link_stats (_MOCK_SHORT_URL , options , app = dltest .app )
118
- assert 'duration_days' in excinfo .value . message
119
- assert 'must be positive int' in excinfo .value . message
118
+ assert 'duration_days' in str ( excinfo .value )
119
+ assert 'must be positive int' in str ( excinfo .value )
120
120
121
121
122
122
class TestEventStats (object ):
@@ -135,7 +135,7 @@ def test_invalid_platform_values(self, arg):
135
135
8000
platform = arg ,
136
136
event = dynamic_links .EVENT_TYPE_CLICK ,
137
137
count = 1 )
138
- assert 'not recognized' in excinfo .value . message
138
+ assert 'not recognized' in str ( excinfo .value )
139
139
140
140
@pytest .mark .parametrize ('arg' , dynamic_links .EventStats ._platforms .keys ())
141
141
def test_raw_platform_values_invalid (self , arg ):
@@ -144,7 +144,7 @@ def test_raw_platform_values_invalid(self, arg):
144
144
platform = arg ,
145
145
event = dynamic_links .EVENT_TYPE_CLICK ,
146
146
count = 1 )
147
- assert 'Raw string' in excinfo .value . message
147
+ assert 'Raw string' in str ( excinfo .value )
148
148
149
149
@pytest .mark .parametrize ('event' , dynamic_links .EventStats ._event_types .keys ())
150
150
def test_valid_event_values (self , event ):
@@ -161,7 +161,7 @@ def test_invalid_event_values(self, arg):
161
161
platform = dynamic_links .PLATFORM_ANDROID ,
162
162
event = arg ,
163
163
count = 1 )
164
- assert 'not recognized' in excinfo .value . message
164
+ assert 'not recognized' in str ( excinfo .value )
165
165
166
166
@pytest .mark .parametrize ('arg' , dynamic_links .EventStats ._event_types .keys ())
167
167
def test_raw_event_values_invalid (self , arg ):
@@ -170,7 +170,7 @@ def test_raw_event_values_invalid(self, arg):
170
170
platform = dynamic_links .PLATFORM_ANDROID ,
171
171
event = arg ,
172
172
count = 1 )
173
- assert 'Raw string' in excinfo .value . message
173
+ assert 'Raw string' in str ( excinfo .value )
174
174
175
175
@pytest .mark .parametrize ('count' , [1 , 123 , 1234 ])
176
176
def test_valid_count_values (self , count ):
@@ -187,21 +187,21 @@ def test_invalid_count_values(self, arg):
187
187
platform = dynamic_links .PLATFORM_ANDROID ,
188
188
event = dynamic_links .EVENT_TYPE_CLICK ,
189
189
count = arg )
190
- assert 'must be a non negative int' in excinfo .value . message
190
+ assert 'must be a non negative int' in str ( excinfo .value )
191
191
192
192
193
193
class TestLinkStatsCreation (object ):
194
194
@pytest .mark .parametrize ('arg' , INVALID_LISTS )
195
195
def test_invalid_event_stats_list (self , arg ):
196
196
with pytest .raises (ValueError ) as excinfo :
197
197
dynamic_links .LinkStats (arg )
198
- assert 'Must be a list or tuple' in excinfo .value . message
198
+ assert 'Must be a list or tuple' in str ( excinfo .value )
199
199
200
200
@pytest .mark .parametrize ('arg' , [list ([1 ,2 ]), list ('asdf' ), tuple ([1 ,2 ])])
201
201
def test_empty_event_stats_list (self , arg ):
202
202
with pytest .raises (ValueError ) as excinfo :
203
203
dynamic_links .LinkStats (arg )
204
- assert 'elements of event stats must be "EventStats"' in excinfo .value . message
204
+ assert 'elements of event stats must be "EventStats"' in str ( excinfo .value )
205
205
206
206
207
207
class TestQuoting (object ):
0 commit comments