Lines Matching +full:python3 +full:- +full:pytest
1 #!/usr/bin/env python3
2 # SPDX-License-Identifier: MIT
35 import pytest
41 def mock_csv(data: typing.List[gen_calendar_entries.CalendarRowType]) -> typing.Iterator[None]:
53 @pytest.fixture(autouse=True, scope='module')
54 def disable_git_commits() -> None:
62 def test_first_is_wednesday(self) -> None:
68 def test_first_is_before_wednesday(self) -> None:
74 def test_first_is_after_wednesday(self) -> None:
84 def _patch_date(date: datetime.date) -> typing.Iterator[None]:
92 @pytest.fixture(scope='class', autouse=True)
93 def data(self) -> None:
98 @pytest.mark.parametrize(
105 def test(self, is_zero: bool, expected: int) -> None:
111 @pytest.fixture(scope='class', autouse=True)
112 def data(self) -> None:
117 @pytest.mark.parametrize(
124 def test(self, is_zero: bool, expected: int) -> None:
130 @pytest.fixture(scope='class', autouse=True)
131 def data(self) -> None:
136 @pytest.mark.parametrize(
143 def test(self, is_zero: bool, expected: int) -> None:
151 ('20.3', '2021-01-13', '20.3.3', 'Dylan Baker', ''),
152 … ('', '2021-01-27', '20.3.4', 'Dylan Baker', 'Last planned release of the 20.3.x series'),
155 @pytest.fixture(autouse=True, scope='class')
156 def mock_version(self) -> None:
161 f.write('21.0.0-devel\n')
166 @pytest.fixture(autouse=True)
167 def csv(self) -> None:
172 def test_basic(self) -> None:
178 expected.append(('21.0', '2021-01-13', f'21.0.0-rc1', 'Dylan Baker'))
179 expected.append(( '', '2021-01-20', f'21.0.0-rc2', 'Dylan Baker'))
180 expected.append(( '', '2021-01-27', f'21.0.0-rc3', 'Dylan Baker'))
181 expected.append(( '', '2021-02-03', f'21.0.0-rc4', 'Dylan Baker', 'Or 21.0.0 final.'))
190 def test_one_release(self) -> None:
192 ('20.3', '2021-01-13', '20.3.3', 'Dylan Baker', ''),
193 …('', '2021-01-27', '20.3.4', 'Dylan Baker', 'This is the last planned release of the 20.3.x se…
206 ('', '2021-01-27', '20.3.4', 'Dylan Baker', ''),
207 ('', '2021-02-10', '20.3.5', 'Dylan Baker', ''),
208 …('', '2021-02-24', '20.3.6', 'Dylan Baker', 'This is the last planned release of the 20.3.x series…
212 def test_one_release(self) -> None:
214 ('20.3', '2021-01-13', '20.3.3', 'Dylan Baker', ''),
215 …('', '2021-01-27', '20.3.4', 'Dylan Baker', 'This is the last planned release of the 20.3.x se…
216 ('21.0', '2021-01-13', '21.0.1', 'Dylan Baker', ''),
217 ('', '2021-01-27', '21.0.2', 'Dylan Baker', ''),
218 ('', '2021-02-10', '21.0.3', 'Dylan Baker', ''),
219 …('', '2021-02-24', '21.0.4', 'Dylan Baker', 'This is the last planned release of the 21.0.x se…
231 d = list(data[-1])
232 d[-1] = ''
233 expected[-1] = tuple(d)
235 …('', '2021-03-10', '21.0.5', 'Dylan Baker', 'This is the last planned release of the 21.0.x se…
240 def test_rc(self) -> None:
242 ('20.3', '2021-01-13', '20.3.3', 'Dylan Baker', ''),
243 …('', '2021-01-27', '20.3.4', 'Dylan Baker', 'This is the last planned release of the 20.3.x se…
244 ('21.0', '2021-01-13', '21.0.0-rc1', 'Dylan Baker', ''),
245 … ('', '2021-01-20', '21.0.0-rc2', 'Dylan Baker', gen_calendar_entries.OR_FINAL.format('21.0')),
257 d = list(expected[-1])
258 d[-1] = ''
259 expected[-1] = tuple(d)
261 ('', '2021-01-27', '21.0.0-rc3', 'Dylan Baker', ''),
262 … ('', '2021-02-03', '21.0.0-rc4', 'Dylan Baker', gen_calendar_entries.OR_FINAL.format('21.0')),
270 @pytest.fixture(autouse=True, scope='class')
271 def _patch_date(self) -> typing.Iterator[None]:
278 ('20.3', '2021-01-13', '20.3.3', 'Dylan Baker', ''),
279 … ('', '2021-01-27', '20.3.4', 'Dylan Baker', 'Last planned release of the 20.3.x series'),
282 @pytest.fixture(autouse=True)
283 def csv(self) -> None:
288 def test_zero_released(self) -> None:
296 expected.append(('21.0', '2021-01-20', f'21.0.1', 'Dylan Baker'))
297 expected.append(( '', '2021-02-03', f'21.0.2', 'Dylan Baker'))
298 …expected.append(( '', '2021-02-17', f'21.0.3', 'Dylan Baker', gen_calendar_entries.LAST_RELEASE…
304 def test_zero_not_released(self) -> None:
312 expected.append(('21.0', '2021-01-13', f'21.0.0', 'Dylan Baker'))
313 expected.append(( '', '2021-01-27', f'21.0.1', 'Dylan Baker'))
314 expected.append(( '', '2021-02-10', f'21.0.2', 'Dylan Baker'))
315 …expected.append(( '', '2021-02-24', f'21.0.3', 'Dylan Baker', gen_calendar_entries.LAST_RELEASE…