|
19 | 19 | test_date = datetime.datetime(1996, 10, 13, 2, 20).replace(tzinfo=pytz.utc) |
20 | 20 | today = datetime.datetime.utcnow().replace(tzinfo=pytz.utc) # make sure UTC |
21 | 21 |
|
22 | | - |
23 | 22 | # TODO: travis matrix to test without pytz installed |
24 | 23 | # TODO: test get_timezone |
25 | 24 |
|
@@ -180,15 +179,18 @@ def test_get_month_number_from_no(month_idx): |
180 | 179 | assert dates.get_month_number(month_idx) == month_idx |
181 | 180 |
|
182 | 181 |
|
183 | | -@pytest.mark.parametrize("value, match", [ |
184 | | - (0, "The given month is not recognised."), |
185 | | - (-1, "The given month is not recognised."), |
186 | | - (13, "The given month is not recognised."), |
187 | | - ("abc", "Unrecognised month value"), |
188 | | - ('0', "Unrecognised month value"), |
189 | | - ("-1", "Unrecognised month value"), |
190 | | - ("13", "Unrecognised month value"), |
191 | | - ]) |
| 182 | +@pytest.mark.parametrize( |
| 183 | + "value, match", |
| 184 | + [ |
| 185 | + (0, "The given month is not recognised."), |
| 186 | + (-1, "The given month is not recognised."), |
| 187 | + (13, "The given month is not recognised."), |
| 188 | + ("abc", "Unrecognised month value"), |
| 189 | + ('0', "Unrecognised month value"), |
| 190 | + ("-1", "Unrecognised month value"), |
| 191 | + ("13", "Unrecognised month value"), |
| 192 | + ] |
| 193 | + ) |
192 | 194 | def test_get_month_number_errors(value, match): |
193 | 195 | with pytest.raises(ValueError, match=match): |
194 | 196 | dates.get_month_number(value) |
|
0 commit comments