@@ -93,138 +93,6 @@ def test_sortable_datetime():
9393 assert blurb .sortable_datetime () == "2025-01-07-16-28-41"
9494
9595
96- @pytest .mark .parametrize (
97- "version1, version2" ,
98- (
99- ("2" , "3" ),
100- ("3.5.0a1" , "3.5.0b1" ),
101- ("3.5.0a1" , "3.5.0rc1" ),
102- ("3.5.0a1" , "3.5.0" ),
103- ("3.6.0b1" , "3.6.0b2" ),
104- ("3.6.0b1" , "3.6.0rc1" ),
105- ("3.6.0b1" , "3.6.0" ),
106- ("3.7.0rc1" , "3.7.0rc2" ),
107- ("3.7.0rc1" , "3.7.0" ),
108- ("3.8" , "3.8.1" ),
109- ),
110- )
111- def test_version_key (version1 , version2 ):
112- # Act
113- key1 = blurb .version_key (version1 )
114- key2 = blurb .version_key (version2 )
115-
116- # Assert
117- assert key1 < key2
118-
119-
120- def test_glob_versions (fs ):
121- # Arrange
122- fake_version_blurbs = (
123- "Misc/NEWS.d/3.7.0.rst" ,
124- "Misc/NEWS.d/3.7.0a1.rst" ,
125- "Misc/NEWS.d/3.7.0a2.rst" ,
126- "Misc/NEWS.d/3.7.0b1.rst" ,
127- "Misc/NEWS.d/3.7.0b2.rst" ,
128- "Misc/NEWS.d/3.7.0rc1.rst" ,
129- "Misc/NEWS.d/3.7.0rc2.rst" ,
130- "Misc/NEWS.d/3.9.0b1.rst" ,
131- "Misc/NEWS.d/3.12.0a1.rst" ,
132- )
133- for fn in fake_version_blurbs :
134- fs .create_file (fn )
135-
136- # Act
137- versions = blurb .glob_versions ()
138-
139- # Assert
140- assert versions == [
141- "3.12.0a1" ,
142- "3.9.0b1" ,
143- "3.7.0" ,
144- "3.7.0rc2" ,
145- "3.7.0rc1" ,
146- "3.7.0b2" ,
147- "3.7.0b1" ,
148- "3.7.0a2" ,
149- "3.7.0a1" ,
150- ]
151-
152-
153- def test_glob_blurbs_next (fs ):
154- # Arrange
155- fake_news_entries = (
156- "Misc/NEWS.d/next/Library/2022-04-11-18-34-33.gh-issue-11111.pC7gnM.rst" ,
157- "Misc/NEWS.d/next/Core and Builtins/2023-03-17-12-09-45.gh-issue-33333.Pf_BI7.rst" ,
158- "Misc/NEWS.d/next/Tools-Demos/2023-03-21-01-27-07.gh-issue-44444.2F1Byz.rst" ,
159- "Misc/NEWS.d/next/C API/2023-03-27-22-09-07.gh-issue-66666.3SN8Bs.rst" ,
160- )
161- fake_readmes = (
162- "Misc/NEWS.d/next/Library/README.rst" ,
163- "Misc/NEWS.d/next/Core and Builtins/README.rst" ,
164- "Misc/NEWS.d/next/Tools-Demos/README.rst" ,
165- "Misc/NEWS.d/next/C API/README.rst" ,
166- )
167- for fn in fake_news_entries + fake_readmes :
168- fs .create_file (fn )
169-
170- # Act
171- filenames = blurb .glob_blurbs ("next" )
172-
173- # Assert
174- assert set (filenames ) == set (fake_news_entries )
175-
176-
177- def test_glob_blurbs_sort_order (fs ):
178- """
179- It shouldn't make a difference to sorting whether
180- section names have spaces or underscores.
181- """
182- # Arrange
183- fake_news_entries = (
184- "Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-01-00.gh-issue-33331.Pf_BI1.rst" ,
185- "Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-02-00.gh-issue-33332.Pf_BI2.rst" ,
186- "Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-03-00.gh-issue-33333.Pf_BI3.rst" ,
187- "Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-04-00.gh-issue-33334.Pf_BI4.rst" ,
188- )
189- # As fake_news_entries, but reverse sorted by *filename* only
190- expected = [
191- "Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-04-00.gh-issue-33334.Pf_BI4.rst" ,
192- "Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-03-00.gh-issue-33333.Pf_BI3.rst" ,
193- "Misc/NEWS.d/next/Core_and_Builtins/2023-07-23-12-02-00.gh-issue-33332.Pf_BI2.rst" ,
194- "Misc/NEWS.d/next/Core and Builtins/2023-07-23-12-01-00.gh-issue-33331.Pf_BI1.rst" ,
195- ]
196- fake_readmes = (
197- "Misc/NEWS.d/next/Library/README.rst" ,
198- "Misc/NEWS.d/next/Core and Builtins/README.rst" ,
199- "Misc/NEWS.d/next/Tools-Demos/README.rst" ,
200- "Misc/NEWS.d/next/C API/README.rst" ,
201- )
202- for fn in fake_news_entries + fake_readmes :
203- fs .create_file (fn )
204-
205- # Act
206- filenames = blurb .glob_blurbs ("next" )
207-
208- # Assert
209- assert filenames == expected
210-
211-
212- @pytest .mark .parametrize (
213- "version, expected" ,
214- (
215- ("next" , "next" ),
216- ("3.12.0a1" , "3.12.0 alpha 1" ),
217- ("3.12.0b2" , "3.12.0 beta 2" ),
218- ("3.12.0rc2" , "3.12.0 release candidate 2" ),
219- ("3.12.0" , "3.12.0 final" ),
220- ("3.12.1" , "3.12.1 final" ),
221- ),
222- )
223- def test_printable_version (version , expected ):
224- # Act / Assert
225- assert blurb .printable_version (version ) == expected
226-
227-
22896@pytest .mark .parametrize (
22997 "news_entry, expected_section" ,
23098 (
0 commit comments